SpriteShapeBox

Family: Sprite · 2 forms

What it does

SpriteShapeBox sets ShapeBox on a Sprite object. It takes iSpriteIndex (an integer), x (a float), y (a float), x2 (a float), y2 (a float) and angle (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
SpriteShapeBox(iSpriteIndex integer, x float, y float, x2 float, y2 float, angle float)
2
SpriteShapeBox(iSpriteIndex integer, x float, y float, x2 float, y2 float, angle float, shapeID integer)

Parameters

NameTypeIn forms
iSpriteIndexintegerall
xfloatall
yfloatall
x2floatall
y2floatall
anglefloatall
shapeIDinteger2

Every form returns

nothing

Example · generated

Form 1, the short one

image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpriteShapeBox(sprite, 100.0, 120.0, 1.0, 1.0, 45.0)DO  Sync()LOOP

Form 2, with every argument

image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpriteShapeBox(sprite, 100.0, 120.0, 1.0, 1.0, 45.0, 1)DO  Sync()LOOP

LoadImage and CreateSprite are there to give the call something to act on; SpriteShapeBox 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.

135 commands in Sprite