GXEntityAnimateMode - boxgaming/gx GitHub Wiki

Gets or sets the animation mode of a specified entity.

Syntax

GXEntityAnimateMode entityId%, mode%
mode% = GXEntityAnimateMode(entityId%)

Description

The entity is identified by the entityId% parameter. This id is returned by the GXEntityCreate function or can be looked up by the GX function. The mode that is returned or set should be one of the following:

Mode Description
GXANIMATE_LOOP Continuously animate through all animation frames in the sequence. This is the default animation mode.
GXANIMATE_SINGLE Stop animation after cycling through the animation frames in the sequence one time.

Examples

Example1: Create and animate an entity.

CONST SEQ_IDLE = 1
CONST SEQ_WALK_RIGHT = 2
CONST SEQ_WALK_LEFT = 3
CONST SEQ_FIST_PUMP = 4

GXSceneCreate 320, 200

DIM SHARED warhog AS LONG
warhog = GXEntityCreate("img/warhog.png", 16, 16, 5)
GXEntityAnimateMode warhog, GXANIMATE_SINGLE
GXEntityAnimate warhog, SEQ_FIST_PUMP, 10

See Also

GXEntityAnimateMode GXEntityCreate GX