LoginLogin
Might make SBS readonly: thread

SPHOME

Root / Documentation / [.]

Created:
Set or get a sprite's home coordinate (transform origin.) The home coordinate is used as the origin (center point) for SPOFS, SPROT, and SPSCALE. Additionally, the home coordinate is used as the origin for sprite collision, and the start point of the default collision box in SPCOL (if a collision box is not specified.) The home coordinate is specified relative to the sprite's upper-left corner, e.g. the center of a sprite is width/2, height/2. If the sprite was set using a definition template, its default home coordinate is set by the template. Otherwise, it is 0,0, or the sprite's upper-left corner.

Syntax

SPHOME spriteID%, homeX%, homeY%
SPHOME spriteID% OUT homeX%, homeY%
ParameterDescription
spriteID%ID of the target sprite: 0 to 4095.
homeX%Home coordinate X,Y of the sprite.
homeY%

Examples

'set the home coordinate
SPHOME 0,8,8
'get the home coordinate
SPHOME 0 OUT HX,HY
PRINT HX,HY

No posts yet (will you be the first?)