AnimationTests CheckAnimatedTime Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D.Tests
Assembly: DeltaEngine.Rendering2D.Tests (in DeltaEngine.Rendering2D.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void CheckAnimatedTime()
Examples

[Test, CloseAfterFirstFrame]
public void CheckAnimatedTime()
{
    var animation = new Sprite(material, Vector2D.Half);
    RunAfterFirstFrame(() =>
    {
        float elapsed = animation.Elapsed;
        var currentFrame = (int)elapsed % 3.0f;
        Assert.AreEqual(currentFrame, animation.CurrentFrame);
    });
}
See Also