DarkBASIC Professional Help File

DX11 PLAY SPRITE

Will set the specified sprite to play between the given start and finish frame.
The speed of the animation can optionally be set, by default it will play 10 frames per second.
Take note that the sprite must have valid image split information for determining the frames or there
will only be a single frame which corresponds to the entirety of the source image. The split information
can be set on a per-sprite basis by using the function DX11 SET SPRITE SHEET SPLIT.
You can optionally decide whether the animation should loop (default behaviour) or not by specifying the
looping flag. If the animation is not set to loop it will play from the first frame to the last and then stop
at the finish frame. If the start frame number is greater than the finish frame number, the animation will be
played in reverse.

Syntax

    DX11 PLAY SPRITE sprite, startFrame, finishFrame, [loop], [fps]

Parameters

    sprite

> Dword
> The sprite to play an animation on.

    startFrame

> Dword
> The frame to start the animation on. Will wrap around to this frame after reaching past the finish frame if looping. Should be in the (0..(splitAcrosssplitDown) - 1) range.

    finishFrame

> Dword
> The frame to finish the animation on. Will wrap around back to the startFrame after reaching past this if looping. Should be in the (0.. (splitAcrosssplitDown) - 1) range.

    [Optional] loop

> Boolean
> Set to true to make the animation loop (start over at the beginning after reaching the end) or false to only play it through once. Defaults to true.

    [Optional] fps

> Float
> The speed at which the animation should change frames, given in frames per second. Will default to 10.

Returns

This function does not return a value.

See also

SPRITE Functions Menu
DX11 Function Categories