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
namestringcellWidthintcellHeightintstartColumnintstartRowintframesintframeratefloatmaterialSpriteMaterial
Properties
CellHeight
The cell height of the animation sheet.
public int CellHeight { get; set; }
Property Value
CellWidth
The cell width of the animation sheet.
public int CellWidth { get; set; }
Property Value
CurrentFrame
The current frame of the animation.
public int CurrentFrame { get; set; }
Property Value
Framerate
The framerate of the animation in frames per second.
public float Framerate { get; set; }
Property Value
Material
The material used for the animation.
public SpriteMaterial Material { get; set; }
Property Value
Name
The name of the animation.
public string Name { get; set; }
Property Value
StartColumn
The starting column of the animation.
public int StartColumn { get; set; }
Property Value
StartRow
The starting row of the animation.
public int StartRow { get; set; }
Property Value
TotalColumns
The total number of columns in the animation.
public int TotalColumns { get; set; }
Property Value
TotalFrames
The total number of frames in the animation.
public int TotalFrames { get; set; }
Property Value
TotalRows
The total number of rows in the animation.
public int TotalRows { get; set; }
Property Value
Methods
GetUVTransform()
Gets the uv transform of the current frame.
public Vector4 GetUVTransform()
Returns
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)