2D sprite node in 3D world, that can use multiple 2D textures for animation.
    public class AnimatedSprite3D : SpriteBase3D

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

Inheritance Chain

Constructors

    public AnimatedSprite3D()

Signals

    "frame_changed" ()

Emitted when Frame changed.

Properties

    public string Animation { get; set; }

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

    public int Frame { get; set; }

The displayed animation frame’s index.

    public SpriteFrames Frames { get; set; }

The SpriteFrames resource containing the animation(s).

    public bool Playing { get; set; }

If true, the Animation is currently playing.

Methods

    public string GetAnimation()

Getter for Animation

    public int GetFrame()

Getter for Frame

    public SpriteFrames GetSpriteFrames()

Getter for Frames

    public bool IsPlaying()

Return true if an animation if currently being played.

    public void Play(string anim = "")

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

    public void SetAnimation(string animation)

Setter for Animation

    public void SetFrame(int frame)

Setter for Frame

    public void SetSpriteFrames(SpriteFrames spriteFrames)

Setter for Frames

    public void Stop()

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

Tags: