RelativeScreenSpaceTests ToPixelSpaceFromRelativeSpace 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 ToPixelSpaceFromRelativeSpace()
Examples

[Test]
public void ToPixelSpaceFromRelativeSpace()
{
    window.ViewportPixelSize = new Size(30, 50);
    var screen = new RelativeScreenSpace(window);
    Assert.AreEqual(new Vector2D(30, 50), screen.ToPixelSpace(Vector2D.One));
    Assert.AreEqual(Size.Zero, screen.ToPixelSpace(Size.Zero));
    Assert.AreEqual(new Vector2D(10, 20), screen.ToPixelSpace(new Vector2D(10 / 30.0f, 20 / 50.0f)));
    Assert.AreEqual(new Size(7.5f, 12.5f), screen.ToPixelSpace(new Size(0.25f)));
}
See Also