What it does
SpriteYFromWorld takes iSpriteIndex (an integer), x (a float) and y (a float), and answers a float. iSpriteIndex is the id of a Sprite object, the one CreateSprite returned: it is how the call knows what to act on.
Syntax
SpriteYFromWorld(iSpriteIndex integer, x float, y float) → floatParameters
| Name | Type |
|---|---|
| iSpriteIndex | integer |
| x | float |
| y | float |
Every form returns
float
Example · generated
image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)DO Print(SpriteYFromWorld(sprite, 100.0, 120.0)) Sync()LOOPLoadImage and CreateSprite are there to give the call something to act on; SpriteYFromWorld is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.