Table of Contents

Class Animator

Namespace
LibGFX.Graphics.Animation2D
Assembly
LibGFX.dll

Represents an animator for 2D animations.

public class Animator
Inheritance
Animator
Inherited Members

Constructors

Animator()

Creates a new animator.

public Animator()

Properties

AnimationCallbacks

The list of animation callbacks associated with this animator.

public List<IAnimationCallback> AnimationCallbacks { get; set; }

Property Value

List<IAnimationCallback>

Animations

The list of animations associated with this animator.

public List<Animation2D> Animations { get; set; }

Property Value

List<Animation2D>

CurrentAnimation

The current animation being played.

public Animation2D CurrentAnimation { get; set; }

Property Value

Animation2D

Loop

public bool Loop { get; set; }

Property Value

bool

Methods

GetCurrentFrame()

Gets the current frame of the animation. It returns the material and the UV transform of the current frame.

public (SpriteMaterial, Vector4) GetCurrentFrame()

Returns

(SpriteMaterial, Vector4)

PlayAnimation(string)

Plays the specified animation.

public void PlayAnimation(string animationName)

Parameters

animationName string

Stop()

Stops the current animation.

public void Stop()

Update(float)

Updates the animator and the current animation.

public void Update(float deltaTime)

Parameters

deltaTime float