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.
Member Variables¶
- String animation - The current animation from the
frames
resource. If this value changes, theframe
counter is reset. - int frame - The displayed animation frame’s index.
- SpriteFrames frames - The SpriteFrames resource containing the animation(s).
- bool playing - If
true
the animation is currently playing.
Description¶
Animations are created using a SpriteFrames resource, which can be configured in the editor via the SpriteFrames panel.
Member Function Description¶
- bool is_playing ( ) const
Return 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).