class_animatedsprite - dragonsoulz/godot GitHub Wiki

AnimatedSprite

####Inherits: Node2D ####Category: Core

Brief Description

Sprite node that can use multiple textures for animation.

Member Functions

Signals

  • frame_changed ( )

Description

Sprite node that can use multiple textures for animation.

Member Function Description

set_sprite_frames

Set the SpriteFrames resource, which contains all frames.

get_sprite_frames

Get the SpriteFrames resource, which contains all frames.

set_centered

  • 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.

is_centered

  • bool is_centered ( ) const

Return true when centered. See [set_centered].

set_offset

  • 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.

get_offset

Return the offset of the sprite in the node origin.

set_flip_h

  • void set_flip_h ( bool flip_h )

If true, sprite is flipped horizontally.

is_flipped_h

  • bool is_flipped_h ( ) const

Return true if sprite is flipped horizontally.

set_flip_v

  • void set_flip_v ( bool flip_v )

If true, sprite is flipped vertically.

is_flipped_v

  • bool is_flipped_v ( ) const

Return true if sprite is flipped vertically.

set_frame

  • void set_frame ( int frame )

Set the visible sprite frame index (from the list of frames inside the SpriteFrames resource).

get_frame

  • int get_frame ( ) const

Return the visible frame index.

set_modulate

  • void set_modulate ( Color modulate )

Change the color modulation (multiplication) for this sprite.

get_modulate

  • Color get_modulate ( ) const

Return the color modulation for this sprite.