SpriteFrames

Inherits: Resource < Reference < Object

Sprite frame library for AnimatedSprite.

Description

Sprite frame library for AnimatedSprite. Contains frames and animation data for playback.

Properties

Array frames

Methods

void add_animation ( StringName anim )
void add_frame ( StringName anim, Texture2D frame, int at_position=-1 )
void clear ( StringName anim )
void clear_all ( )
bool get_animation_loop ( StringName anim ) const
PackedStringArray get_animation_names ( ) const
float get_animation_speed ( StringName anim ) const
Texture2D get_frame ( StringName anim, int idx ) const
int get_frame_count ( StringName anim ) const
bool has_animation ( StringName anim ) const
void remove_animation ( StringName anim )
void remove_frame ( StringName anim, int idx )
void rename_animation ( StringName anim, StringName newname )
void set_animation_loop ( StringName anim, bool loop )
void set_animation_speed ( StringName anim, float speed )
void set_frame ( StringName anim, int idx, Texture2D txt )

Property Descriptions

Compatibility property, always equals to an empty array.

Method Descriptions

Adds a new animation to the library.


Adds a frame to the given animation.


Removes all frames from the given animation.


  • void clear_all ( )

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.