What it does
SpriteShapePolygon sets ShapePolygon on a Sprite object. It takes iSpriteIndex (an integer), numPoints (an integer), index (an integer), x (a float) and y (a float), and returns nothing. That is the first of 2 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
SpriteShapePolygon(iSpriteIndex integer, numPoints integer, index integer, x float, y float)2
SpriteShapePolygon(iSpriteIndex integer, numPoints integer, index integer, x float, y float, shapeID integer)Parameters
| Name | Type | In forms |
|---|---|---|
| iSpriteIndex | integer | all |
| numPoints | integer | all |
| index | integer | all |
| x | float | all |
| y | float | all |
| shapeID | integer | 2 |
Every form returns
nothing
Example · generated
Form 1, the short one
image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpriteShapePolygon(sprite, 10, 1, 100.0, 120.0)DO Sync()LOOPForm 2, with every argument
image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpriteShapePolygon(sprite, 10, 1, 100.0, 120.0, 1)DO Sync()LOOPLoadImage and CreateSprite are there to give the call something to act on; SpriteShapePolygon 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.