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

[Test]
public void ToPixelInFullHdResolution()
{
    window.ViewportPixelSize = new Size(1920, 1080);
    var screen = new QuadraticScreenSpace(window);
    Assert.AreEqual(new Vector2D(1680, 1500), screen.ToPixelSpace(new Vector2D(0.875f, 1f)));
    var somePoint = screen.FromPixelSpace(new Vector2D(324, 483));
    var somePointPlusOne = screen.FromPixelSpace(new Vector2D(325, 483));
    Assert.IsFalse(somePoint.X.IsNearlyEqual(somePointPlusOne.X),
        somePoint + " should not be nearly equal to " + somePointPlusOne);
    Assert.AreEqual(new Vector2D(324, 483), screen.ToPixelSpaceRounded(somePoint));
    Assert.AreEqual(new Vector2D(325, 483), screen.ToPixelSpaceRounded(somePointPlusOne));
}
See Also