Inherits: Resource < Reference < Object
Sprite frame library for AnimatedSprite.
Sprite frame library for AnimatedSprite. Contains frames and animation data for playback.
Note: You can associate a set of normal maps by creating additional SpriteFrames
resources with a _normal
suffix. For example, having 2 SpriteFrames
resources run
and run_normal
will make it so the run
animation uses the normal map.
Array | frames |
void | add_animation ( String anim ) |
void | add_frame ( String anim, Texture frame, int at_position=-1 ) |
void | clear ( String anim ) |
void | clear_all ( ) |
bool | get_animation_loop ( String anim ) const |
PoolStringArray | get_animation_names ( ) const |
float | get_animation_speed ( String anim ) const |
Texture | get_frame ( String anim, int idx ) const |
int | get_frame_count ( String anim ) const |
bool | has_animation ( String anim ) const |
void | remove_animation ( String anim ) |
void | remove_frame ( String anim, int idx ) |
void | rename_animation ( String anim, String newname ) |
void | set_animation_loop ( String anim, bool loop ) |
void | set_animation_speed ( String anim, float speed ) |
void | set_frame ( String anim, int idx, Texture txt ) |
Compatibility property, always equals to an empty array.
Adds a new animation to the library.
Adds a frame to the given animation.
Removes all frames from the given animation.
Removes all animations. A "default" animation will be created.
If true
, the given animation will loop.
Returns an array containing the names associated to each animation. Values are placed in alphabetical order.
The animation's speed in frames per second.
Returns the animation's selected frame.
Returns the number of frames in the animation.
If true
, the named animation exists.
Removes the given animation.
Removes the animation's selected frame.
Changes the animation's name to newname
.
If true
, the animation will loop.
The animation's speed in frames per second.
Sets the texture of the given frame.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_spriteframes.html