varollo.asepriteimporter.mg.asepriteanimation - Varollo/aseprite-importer GitHub Wiki

< Back


AsepriteAnimation

Namespace: Varollo.AsepriteImporter.MG

Object representing a animation of .

public class AsepriteAnimation

Inheritance ObjectAsepriteAnimation

Properties

Name

or corresponding to the animation.

public string Name { get; }

Property Value

String

TotalDuration

Sum of for all frames in the animation.
(and reversed) double original animation duration.

public TimeSpan TotalDuration { get; }

Property Value

TimeSpan

FrameCount

Amount of frames present in the animation.

public int FrameCount { get; }

Property Value

Int32

Methods

GetFrameByID(Int32)

Retrieves a frame in the animation by it's index or "frameID".
Out of bounds "frameID" values are wrapped back to 0.

public AsepriteFrame GetFrameByID(int frameID)

Parameters

frameID Int32
Order, starting from 0, which the frame appears in the animation.

Returns

AsepriteFrame
Frame at position ""

GetFrameByTime(Double)

Retrieves the frame in the animation that is suposed to be shown at a elapsed time, in milliseconds.
Out of bounds "elapsedMillis" values are wrapped back to 0.

public AsepriteFrame GetFrameByTime(double elapsedMillis)

Parameters

elapsedMillis Double
Point in time, in milliseconds, during the animation to retrieve a frame from.

Returns

AsepriteFrame
Frame at "elapsedMillis" point in time.

Exceptions

InvalidOperationException
This should not occour, if it does, it's a sign my code doesn't work!


< Back

⚠️ **GitHub.com Fallback** ⚠️