AnimatedSprite¶
Inherits: Node2D < CanvasItem < Node < Object
Category: Core
Brief Description¶
Sprite node that can use multiple textures for animation.
Member Functions¶
int | get_frame ( ) const |
Color | get_modulate ( ) const |
Vector2 | get_offset ( ) const |
SpriteFrames | get_sprite_frames ( ) const |
bool | is_centered ( ) const |
bool | is_flipped_h ( ) const |
bool | is_flipped_v ( ) const |
void | set_centered ( bool centered ) |
void | set_flip_h ( bool flip_h ) |
void | set_flip_v ( bool flip_v ) |
void | set_frame ( int frame ) |
void | set_modulate ( Color modulate ) |
void | set_offset ( Vector2 offset ) |
void | set_sprite_frames ( SpriteFrames sprite_frames ) |
Signals¶
- frame_changed ( )
Description¶
Sprite node that can use multiple textures for animation.
Member Function Description¶
- int get_frame ( ) const
Return the visible frame index.
- Color get_modulate ( ) const
Return the color modulation for this sprite.
- Vector2 get_offset ( ) const
Return the offset of the sprite in the node origin.
- SpriteFrames get_sprite_frames ( ) const
Get the SpriteFrames resource, which contains all frames.
- bool is_centered ( ) const
Return true when centered. See set_centered.
- bool is_flipped_h ( ) const
Return true if sprite is flipped horizontally.
- bool is_flipped_v ( ) const
Return true if sprite is flipped vertically.
- void set_centered ( bool centered )
When turned on, offset at (0,0) is the center of the sprite, when off, the top-left corner is.
- void set_flip_h ( bool flip_h )
If true, sprite is flipped horizontally.
- void set_flip_v ( bool flip_v )
If true, sprite is flipped vertically.
- void set_frame ( int frame )
Set the visible sprite frame index (from the list of frames inside the SpriteFrames resource).
- void set_modulate ( Color modulate )
Change the color modulation (multiplication) for this sprite.
- void set_offset ( Vector2 offset )
Set the offset of the sprite in the node origin. Position varies depending on whether it is centered or not.
- void set_sprite_frames ( SpriteFrames sprite_frames )
Set the SpriteFrames resource, which contains all frames.