SpriteImage

Family: Sprite · 2 forms

What it does

SpriteImage sets Image on a Sprite object. It takes iSpriteIndex (an integer) and iImageIndex (an integer), 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
SpriteImage(iSpriteIndex integer, iImageIndex integer)
2
SpriteImage(iSpriteIndex integer, iImageIndex integer, bUpdateShape integer)

Parameters

NameTypeIn forms
iSpriteIndexintegerall
iImageIndexintegerall
bUpdateShapeinteger2

Every form returns

nothing

Example · generated

Form 1, the short one

image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)image = LoadImageResized("assets/sprite.png", 1.0, 1.0, 1)SpriteImage(sprite, image)DO  Sync()LOOP

Form 2, with every argument

image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)image = LoadImageResized("assets/sprite.png", 1.0, 1.0, 1)SpriteImage(sprite, image, 1)DO  Sync()LOOP

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