Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
123 lines (79 sloc) 4.61 KB

AnimatedSprite3D

Inherits: :ref:`SpriteBase3D<class_SpriteBase3D>` < :ref:`GeometryInstance<class_GeometryInstance>` < :ref:`VisualInstance<class_VisualInstance>` < :ref:`Spatial<class_Spatial>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

Category: Core

Brief Description

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

Properties

:ref:`String<class_String>` :ref:`animation<class_AnimatedSprite3D_property_animation>`
:ref:`int<class_int>` :ref:`frame<class_AnimatedSprite3D_property_frame>`
:ref:`SpriteFrames<class_SpriteFrames>` :ref:`frames<class_AnimatedSprite3D_property_frames>`
:ref:`bool<class_bool>` :ref:`playing<class_AnimatedSprite3D_property_playing>`

Methods

:ref:`bool<class_bool>` :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` ( ) const
void :ref:`play<class_AnimatedSprite3D_method_play>` ( :ref:`String<class_String>` anim="" )
void :ref:`stop<class_AnimatedSprite3D_method_stop>` ( )

Signals

  • frame_changed ( )

Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.

Description

Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.

Property Descriptions

Setter set_animation(value)
Getter get_animation()

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

Setter set_frame(value)
Getter get_frame()

The displayed animation frame's index.

Setter set_sprite_frames(value)
Getter get_sprite_frames()

The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).

If true, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.

Method Descriptions

Returns true if an animation if currently being played.

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

You can’t perform that action at this time.