animated_texture
Last updated
Last updated
This type is an animated texture. This texture type only supports animated GIF types, and does not support APNG.
If you pass an unsupported type, it will instead work exactly like type, meaning controlling frames and looping will be meaningless.
Using this type for texture atlases is possible, although highly unrecommended. It will produce extra texture objects in memory, and overall will be much slower. Instead, it is advised to construct an actual texture atlas, use type, and use texture mapping.
Constructs animated texture.
Passing an invalid pointer, a or memory region that is smaller than the size will result in a crash.
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
Type: bool
If set to false
, will not loop the animation automatically. Defaults to true
.
Reset loop to run from the first frame.
Arguments
None.
Returns
Nothing.
Example
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.
Arguments
Name
Type
Description
frame
int
Frame number. Invalid frame numbers will be clamped.
Returns
Nothing.
Example
Returns amount of frames in the animation.
Arguments
None.
Returns
Type
Description
int
Frame count.
Example