QuadraticScreenSpaceTests SquareWindowWithQuadraticSpace 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 SquareWindowWithQuadraticSpace()
Examples

[Test]
public void SquareWindowWithQuadraticSpace()
{
    ScreenSpace.Current = new QuadraticScreenSpace(window);
    window.ViewportPixelSize = new Size(100, 100);
    Assert.AreEqual(Vector2D.Zero, ScreenSpace.Current.TopLeft);
    Assert.AreEqual(Vector2D.One, ScreenSpace.Current.BottomRight);
    Assert.AreEqual(Rectangle.One, ScreenSpace.Current.Viewport);
    Assert.AreEqual(Vector2D.One, ScreenSpace.Current.FromPixelSpace(new Vector2D(100, 100)));
    Assert.AreEqual(Vector2D.Half, ScreenSpace.Current.FromPixelSpace(new Vector2D(50, 50)));
    Assert.IsTrue(
        ScreenSpace.Current.FromPixelSpace(new Rectangle(10, 10, 80, 80)).IsNearlyEqual(
            new Rectangle(0.1f, 0.1f, 0.8f, 0.8f)));
}
See Also