SpriteFrames

Inherits: Resource < Reference < Object

Sprite frame library for AnimatedSprite.

Description

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

Properties

Arrayframes

Methods

voidadd_animation ( String anim )
voidadd_frame ( String anim, Texture frame, int at_position=-1 )
voidclear ( String anim )
voidclear_all ( )
boolget_animation_loop ( String anim ) const
PoolStringArrayget_animation_names ( ) const
floatget_animation_speed ( String anim ) const
Textureget_frame ( String anim, int idx ) const
intget_frame_count ( String anim ) const
boolhas_animation ( String anim ) const
voidremove_animation ( String anim )
voidremove_frame ( String anim, int idx )
voidrename_animation ( String anim, String newname )
voidset_animation_loop ( String anim, bool loop )
voidset_animation_speed ( String anim, float speed )
voidset_frame ( String anim, int idx, Texture txt )

Property Descriptions

Compatibility property, always equals to an empty array.

Method Descriptions

  • void add_animation ( String anim )

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.


  • void remove_animation ( String anim )

Removes the given animation.


Removes the animation’s selected frame.


Changes the animation’s name to newname.


  • void set_animation_loop ( String anim, bool loop )

If true, the animation will loop.


The animation’s speed in frames per second.


Sets the texture of the given frame.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.