AnimatedTexture

This type is an animated texture. This texture type only supports animated GIF types, and does not support APNG.

circle-info

This type inherits Texture type. All of its base methods and fields are also available in this type.

circle-check
circle-check

__call

Constructor

Constructs animated texture.

triangle-exclamation

Arguments

1. From file.

Name

Type

Description

path

string

Path to the texture file.

2. From memory.

Name

Type

Description

data

Pointer to texture file data in memory.

sz

int

Size of the texture file data.

Returns

Type

Description

animated_texture

Animated texture instance.

Example


shouldLoop

Field

Type: bool

If set to false, will not loop the animation automatically. Defaults to true.


ResetLoop

Method

Reset loop to run from the first frame.

Arguments

None.

Returns

Nothing.

Example


SetFrame

Method

Set a specific frame on the animation. If looping is enabled, will continue the cycle from the passed frame. Otherwise, will display a specific frame of the animation.

circle-info

Frame count starts from 0.

Arguments

Name

Type

Description

frame

int

Frame number. Invalid frame numbers will be clamped.

Returns

Nothing.

Example


GetFrameCount

Method

Returns amount of frames in the animation.

Arguments

None.

Returns

Type

Description

int

Frame count.

Example

Last updated