What it does
SpriteAnimation sets Animation on a Sprite object. It takes iSpriteIndex (an integer), iFrameWidth (an integer), iFrameHeight (an integer) and iFrameCount (an integer), and returns nothing. iSpriteIndex is the id of a Sprite object, the one CreateSprite returned: it is how the call knows what to act on.
Syntax
SpriteAnimation(iSpriteIndex integer, iFrameWidth integer, iFrameHeight integer, iFrameCount integer)Parameters
| Name | Type |
|---|---|
| iSpriteIndex | integer |
| iFrameWidth | integer |
| iFrameHeight | integer |
| iFrameCount | integer |
Every form returns
nothing
Example · generated
image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpriteAnimation(sprite, 64, 64, 10)DO Sync()LOOPLoadImage and CreateSprite are there to give the call something to act on; SpriteAnimation 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.