reckfellENGINE

AnimatedSprite3D

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

On this page
class AnimatedSprite3DReckfellSharpInherits SpriteBase3D

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

AnimatedSprite3D is similar to the Sprite3D node, except it carries multiple textures as animation AnimatedSprite3D.SpriteFrames. Animations are created using a SpriteFrames resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The SpriteFrames resource can be configured in the editor via the SpriteFrames bottom panel.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

AnimatedSprite3DConstructor
# AnimatedSprite3D
C#
public AnimatedSprite3D();

Properties6

AnimationProperty
# Animation
C#
public StringName Animation { get; set; }

The current animation from the AnimatedSprite3D.SpriteFrames resource. If this value is changed, the AnimatedSprite3D.Frame counter and the AnimatedSprite3D.FrameProgress are reset.

AutoplayProperty
# Autoplay
C#
public string Autoplay { get; set; }

The key of the animation to play when the scene loads.

FrameProperty
# Frame
C#
public int Frame { get; set; }

The displayed animation frame's index. Setting this property also resets AnimatedSprite3D.FrameProgress. If this is not desired, use AnimatedSprite3D.SetFrameAndProgress.

FrameProgressProperty
# FrameProgress
C#
public float FrameProgress { get; set; }

The progress value between 0.0 and 1.0 until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from 1.0 to 0.0.

SpeedScaleProperty
# SpeedScale
C#
public float SpeedScale { get; set; }

The speed scaling ratio. For example, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. If set to a negative value, the animation is played in reverse. If set to 0, the animation will not advance.

SpriteFramesProperty
# SpriteFrames
C#
public SpriteFrames SpriteFrames { get; set; }

The SpriteFrames resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the SpriteFrames resource.

Methods19

GetAnimationStringName
# GetAnimation
C#
public StringName GetAnimation();
Returns StringName
GetAutoplaystring
# GetAutoplay
C#
public string GetAutoplay();
Returns string
GetFrameint
# GetFrame
C#
public int GetFrame();
Returns int
GetFrameProgressfloat
# GetFrameProgress
C#
public float GetFrameProgress();
Returns float
GetPlayingSpeedfloat
# GetPlayingSpeed
C#
public float GetPlayingSpeed();

Returns the actual playing speed of current animation or 0 if not playing. This speed is the AnimatedSprite3D.SpeedScale property multiplied by custom_speed argument specified when calling the AnimatedSprite3D.Play method. Returns a negative value if the current animation is playing backwards.

Returns float
GetSpeedScalefloat
# GetSpeedScale
C#
public float GetSpeedScale();
Returns float
GetSpriteFramesSpriteFrames
# GetSpriteFrames
C#
public SpriteFrames GetSpriteFrames();
Returns SpriteFrames
IsPlayingbool
# IsPlaying
C#
public bool IsPlaying();

Returns true if an animation is currently playing (even if AnimatedSprite3D.SpeedScale and/or custom_speed are 0).

Returns bool
Pausevoid
# Pause
C#
public void Pause();

Pauses the currently playing animation. The AnimatedSprite3D.Frame and AnimatedSprite3D.FrameProgress will be kept and calling AnimatedSprite3D.Play or AnimatedSprite3D.PlayBackwards without arguments will resume the animation from the current playback position. See also AnimatedSprite3D.Stop.

Playvoid
# Play
C#
public void Play(StringName name = null, float customSpeed = 1f, bool fromEnd = false);

Plays the animation with key name. If custom_speed is negative and from_end is true, the animation will play backwards (which is equivalent to calling AnimatedSprite3D.PlayBackwards). If this method is called with that same animation name, or with no name parameter, the assigned animation will resume playing if it was paused.

Parameters
NameTypeDefault
nameStringNamenull
customSpeedfloat1f
fromEndboolfalse
PlayBackwardsvoid
# PlayBackwards
C#
public void PlayBackwards(StringName name = null);

Plays the animation with key name in reverse. This method is a shorthand for AnimatedSprite3D.Play with custom_speed = -1.0 and from_end = true, so see its description for more information.

Parameters
NameTypeDefault
nameStringNamenull
SetAnimationvoid
# SetAnimation
C#
public void SetAnimation(StringName name);
Parameters
NameTypeDefault
nameStringName—
SetAutoplayvoid
# SetAutoplay
C#
public void SetAutoplay(string name);
Parameters
NameTypeDefault
namestring—
SetFramevoid
# SetFrame
C#
public void SetFrame(int frame);
Parameters
NameTypeDefault
frameint—
SetFrameAndProgressvoid
# SetFrameAndProgress
C#
public void SetFrameAndProgress(int frame, float progress);

Sets AnimatedSprite3D.Frame and AnimatedSprite3D.FrameProgress to the given values. Unlike setting AnimatedSprite3D.Frame, this method does not reset the AnimatedSprite3D.FrameProgress to 0.0 implicitly. Example: Change the animation while keeping the same AnimatedSprite3D.Frame and AnimatedSprite3D.FrameProgress:

Parameters
NameTypeDefault
frameint—
progressfloat—
SetFrameProgressvoid
# SetFrameProgress
C#
public void SetFrameProgress(float progress);
Parameters
NameTypeDefault
progressfloat—
SetSpeedScalevoid
# SetSpeedScale
C#
public void SetSpeedScale(float speedScale);
Parameters
NameTypeDefault
speedScalefloat—
SetSpriteFramesvoid
# SetSpriteFrames
C#
public void SetSpriteFrames(SpriteFrames spriteFrames);
Parameters
NameTypeDefault
spriteFramesSpriteFrames—
Stopvoid
# Stop
C#
public void Stop();

Stops the currently playing animation. The animation position is reset to 0 and the custom_speed is reset to 1.0. See also AnimatedSprite3D.Pause.

Signals and events5

AnimationChangedEvent
# AnimationChanged
C#
public event Action AnimationChanged;

Emitted when AnimatedSprite3D.Animation changes.

AnimationFinishedEvent
# AnimationFinished
C#
public event Action AnimationFinished;

Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. Note: This signal is not emitted if an animation is looping.

AnimationLoopedEvent
# AnimationLooped
C#
public event Action AnimationLooped;

Emitted when the animation loops.

FrameChangedEvent
# FrameChanged
C#
public event Action FrameChanged;

Emitted when AnimatedSprite3D.Frame changes.

SpriteFramesChangedEvent
# SpriteFramesChanged
C#
public event Action SpriteFramesChanged;

Emitted when AnimatedSprite3D.SpriteFrames changes.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.