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

    [Obsolete("GetAnimation is deprecated. Use the Animation property instead.")]
    public string GetAnimation()

Getter for Animation

    [Obsolete("GetFrame is deprecated. Use the Frame property instead.")]
    public int GetFrame()

Getter for Frame

    [Obsolete("GetSpriteFrames is deprecated. Use the Frames property instead.")]
    public SpriteFrames GetSpriteFrames()

Getter for Frames

    public bool IsPlaying()

Returns true if an animation is currently being played.

    public void Play(string anim = "")

Plays the animation named anim. If no anim is provided, the current animation is played.

    [Obsolete("SetAnimation is deprecated. Use the Animation property instead.")]
    public void SetAnimation(string animation)

Setter for Animation

    [Obsolete("SetFrame is deprecated. Use the Frame property instead.")]
    public void SetFrame(int frame)

Setter for Frame

    [Obsolete("SetSpriteFrames is deprecated. Use the Frames property instead.")]
    public void SetSpriteFrames(SpriteFrames spriteFrames)

Setter for Frames

    public void Stop()

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

Tags: