AddSpriteAnimationFrame

Family: Sprite · One form

What it does

AddSpriteAnimationFrame adds AnimationFrame on a Sprite object. It takes iSpriteIndex (an integer) and iImageIndex (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

AddSpriteAnimationFrame(iSpriteIndex integer, iImageIndex integer)

Parameters

NameType
iSpriteIndexinteger
iImageIndexinteger

Every form returns

nothing

Example · generated

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

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