Camera2DScreenSpaceTests ToPixelSpaceWithRotation Method Delta Engine Documentation

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

public void ToPixelSpaceWithRotation()
Examples

[Test]
public void ToPixelSpaceWithRotation()
{
    var quadraticSize = new Size(window.ViewportPixelSize.Width);
    var camera = new Camera2DScreenSpace(window) { Rotation = 90.0f };
    Assert.AreEqual(0.0f, camera.ToPixelSpace(Vector2D.Zero).X);
    Assert.IsTrue(camera.ToPixelSpace(Vector2D.Half).IsNearlyEqual(new Vector2D(-160.0f, 90.0f)));
    Assert.IsTrue(
        camera.ToPixelSpace(Vector2D.One).IsNearlyEqual(new Vector2D(-320.0f, (160.0f + 90.0f))));
    Assert.AreEqual(quadraticSize, camera.ToPixelSpace(Size.One));
}
See Also