W3cubDocs

/Godot 3.1

AnimatedSprite3D

Inherits: SpriteBase3D < GeometryInstance < VisualInstance < Spatial < Node < Object

Category: Core

Brief Description

2D sprite node in 3D world, that can use multiple 2D textures for animation.

Properties

String animation
int frame
SpriteFrames frames
bool playing

Methods

bool is_playing ( ) const
void play ( String anim=”” )
void stop ( )

Signals

frame_changed ( )

Emitted when frame changed.

Description

Animations are created using a SpriteFrames resource, which can be configured in the editor via the SpriteFrames panel.

Property Descriptions

String animation

Setter set_animation(value)
Getter get_animation()

The current animation from the frames resource. If this value changes, the frame counter is reset.

int frame

Setter set_frame(value)
Getter get_frame()

The displayed animation frame’s index.

SpriteFrames frames

Setter set_sprite_frames(value)
Getter get_sprite_frames()

The SpriteFrames resource containing the animation(s).

bool playing

If true, the animation is currently playing.

Method Descriptions

bool is_playing ( ) const

Returns true if an animation if currently being played.

void play ( String anim=”” )

Play the animation set in parameter. If no parameter is provided, the current animation is played.

void stop ( )

Stop the current animation (does not reset the frame counter).

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.1/classes/class_animatedsprite3d.html