[↑]
SmileBASIC4 Replica Reference
SPVAR
1. Set sprite variables

SPVAR SpriteNumber,VariableKey,Value

・All sprites have special variables called sprite variables.
・Sprite variables are cleared when program execution starts or when SPSET or SPCLR is called.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

VariableKey

The name of the sprite variable

・A string or Int can be given as a name.

Value

Value to be registered in internal variable

・Numerical values or strings can be registered.

Example

SPVAR 0,7,1
SPVAR 0,"NAME","VALUE" 
2. Read sprite variables

SPVAR(SpriteNumber,VariableKey)

Arguments

SpriteNumber

Target sprite number: 0 to 4095

VariableKey

The name of the sprite variable: string or Int can be named.

Return Value

Value registered with SPVAR

If no value is registered with SPVAR, the Int 0 is returned.

Example

V=SPVAR(54,0)
3. Delete sprite variables

SPVAR SpriteNumber[,VariableKey]

Arguments

SpriteNumber

Target sprite number: 0 to 4095

VariableKey

The name of the sprite variable to delete

・A string or Int can be given as a name.
・If not specified, all sprite variables of the specified sprite are deleted.

Example

SPVAR 0,7
SPVAR 0,"NAME" 
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
|