Table of Contents

Class Animation2D

Namespace
LibGFX.Graphics.Animation2D
Assembly
LibGFX.dll

Represents a 2D animation. Based on a sprite sheet.

public class Animation2D
Inheritance
Animation2D
Inherited Members

Constructors

Animation2D(string, int, int, int, int, int, float, SpriteMaterial)

Creates a new animation.

public Animation2D(string name, int cellWidth, int cellHeight, int startColumn, int startRow, int frames, float framerate, SpriteMaterial material)

Parameters

name string
cellWidth int
cellHeight int
startColumn int
startRow int
frames int
framerate float
material SpriteMaterial

Properties

CellHeight

The cell height of the animation sheet.

public int CellHeight { get; set; }

Property Value

int

CellWidth

The cell width of the animation sheet.

public int CellWidth { get; set; }

Property Value

int

CurrentFrame

The current frame of the animation.

public int CurrentFrame { get; set; }

Property Value

int

Framerate

The framerate of the animation in frames per second.

public float Framerate { get; set; }

Property Value

float

Material

The material used for the animation.

public SpriteMaterial Material { get; set; }

Property Value

SpriteMaterial

Name

The name of the animation.

public string Name { get; set; }

Property Value

string

StartColumn

The starting column of the animation.

public int StartColumn { get; set; }

Property Value

int

StartRow

The starting row of the animation.

public int StartRow { get; set; }

Property Value

int

TotalColumns

The total number of columns in the animation.

public int TotalColumns { get; set; }

Property Value

int

TotalFrames

The total number of frames in the animation.

public int TotalFrames { get; set; }

Property Value

int

TotalRows

The total number of rows in the animation.

public int TotalRows { get; set; }

Property Value

int

Methods

GetUVTransform()

Gets the uv transform of the current frame.

public Vector4 GetUVTransform()

Returns

Vector4

Update(float, out bool)

Updates the animation. It updates the current frame based on the framerate and the time passed since the last frame update.

public void Update(float deltaTime, out bool finished)

Parameters

deltaTime float
finished bool