Skip to content

class_animatedsprite

reduz edited this page Apr 15, 2014 · 14 revisions

AnimatedSprite

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

Brief Description

Sprite node that can use multiple textures for animation.

Member Functions

Description

Sprite node that can use multiple textures for animation.

Member Function Description

Set the SpriteFrames resource, which contains all frames.

Get the SpriteFrames resource, which contains all frames.

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

  • bool is_centered ( ) const

Return true when centered. See [set_centered].

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

Return the offset of the sprite in the node origin.

  • void set_flip_h ( bool flip_h )

If true, sprite is flipped horizontally.

  • bool is_flipped_h ( ) const

Return true if sprite is flipped horizontally.

  • void set_flip_v ( bool flip_v )

If true, sprite is flipped vertically.

  • bool is_flipped_v ( ) const

Return true if sprite is flipped vertically.

  • void set_frame ( int frame )

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

  • int get_frame ( ) const

Return the visible frame index.

  • void set_modulate ( Color modulate )

Change the color modulation (multiplication) for this sprite.

  • Color get_modulate ( ) const

Return the color modulation for this sprite.

Clone this wiki locally