[↑]
SmileBASIC4 Replica Reference
SPLINK
1. Link a sprite to another sprite

SPLINK SpriteNumber,LinkDestinationSpriteNumber[,LinkFlag]

・When linked, the coordinates will follow the link destination (parent).
・The display coordinates and display priority of the child are relative coordinates based on the parent.
・Error when used before SPSET.

Arguments

SpriteNumber

Link source (child) sprite number: 0 to 4095

LinkSpriteNumber

Link (parent) sprite number: 0 to 4095

・An error occurs if the descendant of the link source is specified.

LinkFlags

Combination of bit values that specify which link destination (parent) attribute is inherited

・Specify when you want to inherit attributes other than display coordinates and display priority.
・If bit0 is specified, descendants are deleted 1V after the parent has been SPCLR.
・0, if not specified.

bit0 1 Display ON / OFF and Erase Timing
bit1 2 Rotation
bit2 4 Scaling
bit3 8 Color
bit4 16 Layer ID

Example

SPLINK 15,4
SPLINK 2,0,3
2. Get the link number of the specified number sprite

SPLINK(SpriteNumber[,LinkType])

・Error when used before SPSET.

Arguments

SpriteNumber

Link source (child) sprite number: 0 to 4095

LinkType

Type of link destination and link flag to be obtained.

0 Parent
1 Child
2 Brother
3 LinkFlag

・Default is 0.

Return Value

Link number: 0 to 4095 (No link when -1)

Example

'Pick up every child of the sprite PARENT
CHILD=SPLINK( PARENT,1 ) 'The first child
WHILE CHILD!=-1
CHILD=SPLINK( CHILD, 2 ) 'Get brothers in order
WEND
About this site
Our site is an unofficial manual site of programming software "SmileBASIC" for NintendoSwitch™.
I acquire the content of the site from the official reference site of the SmileBoom Co.Ltd. that is the development and sales cause of the software in real time (a minimum period of 24 hours update) and display it. For automatic update, contents may become improper.
Please confirm the correct content in an official site.

June 3, 2020
by mim
OK
|