[↑]
SmileBASIC4 Replica Reference
SPHOME
1. Specify the sprite's home coordinate (coordinate reference point)

SPHOME SpriteNumber,CoordinateX,CoordinateY

・The home coordinates are used as reference points for SPOFS(Movement), SPROT(Rotation), and SPSCALE(Enlargement/Reduction).
・SPCOL (collision detection) uses the value of SPHOME as the default value when the starting point X and Y are not specified. For details, see the SPCOL description.
・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number for setting the reference point: 0 to 4095

CoordinateX,Y

Relative coordinates with the upper left corner of the sprite as the origin (0,0)

・Depending on the hardware specifications, setting a Real value may shift the reference image by one pixel.

Example

SPHOME 34,16,16
2. Get home position of sprite

SPHOME SpriteNumber OUT HX,HY

・Error when used before SPSET.

Argument

SpriteNumber

Sprite number: 0 to 4095

Return Value

HX,HY

Home coordinates

Example

SPHOME 10 OUT HX,HY
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
|