What it does
SpriteGroup takes iSpriteIndex (an integer), and answers an integer. That is the first of 3 forms. iSpriteIndex is the id of a Sprite object, the one CreateSprite returned: it is how the call knows what to act on.
Syntax
1
SpriteGroup(iSpriteIndex integer) → integer2
SpriteGroup(iSpriteIndex integer, group integer)3
SpriteGroup(iSpriteIndex integer, group integer, shapeID integer)Parameters
| Name | Type | In forms |
|---|---|---|
| iSpriteIndex | integer | all |
| group | integer | 2, 3 |
| shapeID | integer | 3 |
What each form returns
| 1 | SpriteGroup(sprite) | integer |
| 2 | SpriteGroup(sprite, 1) | nothing |
| 3 | SpriteGroup(sprite, 1, 1) | nothing |
Example · generated
Form 1, the command hands back the id
image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)DO Print(SpriteGroup(sprite)) Sync()LOOPForm 2, you choose the id yourself
image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpriteGroup(sprite, 1)DO Sync()LOOPLoadImage and CreateSprite are there to give the call something to act on; SpriteGroup 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.