GXEntityAnimateStop - boxgaming/gx GitHub Wiki
Stops animation of the current animation sequence.
Syntax
GXEntityAnimateStop entityId%
Parameters
- Entity to animate is specified by the entityId% parameter. This id is returned by the GXEntityCreate function or can be accessed by its user id by the GX function.
Examples
Example1: Create and animate an entity.
'$INCLUDE: 'gx.bi'
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
GXSceneStart
SUB GXOnGameEvent (e as GXEvent)
SELECT CASE e.event
CASE GXEVENT_UPDATE:
IF GXKeyDown(GXKEY_ESC) THEN
GXEntityAnimateStop warhog
END IF
END SELECT
END SUB
'$INCLUDE: 'gx.bm'