GXEntityAnimate - boxgaming/gx GitHub Wiki

Animates a specified entity.

Syntax

GXEntityAnimate entityId%, sequence%, speed%

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.
  • The sequence% parameter indicates which animation sequence should be used.
  • The speed of the animation is specified by the speed% parameter. This value should be specified in frames-per-second (FPS). Setting this value to 0 will stop the animation.

Examples

Example1: Create and animate an entity.

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

GXSceneCreate 320, 200

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

See Also

GXEntityAnimateMode GXEntityCreate GX