Namespace: DeltaEngine.Tests.ScreenSpaces
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Examples
[Test] public void ToPixelWithNonSquareWindow() { window.ViewportPixelSize = new Size(100, 75); var screen = new QuadraticScreenSpace(window); Assert.AreEqual(new Vector2D(100, 75), screen.ToPixelSpace(new Vector2D(1f, 0.875f))); Assert.AreEqual(Vector2D.Zero, screen.ToPixelSpace(new Vector2D(0, 0.125f))); Assert.AreEqual(new Vector2D(50, 37.5f), screen.ToPixelSpace(Vector2D.Half)); Assert.AreEqual(new Size(10, 20), screen.ToPixelSpace(new Size(0.1f, 0.2f))); Assert.IsTrue( screen.ToPixelSpace(new Rectangle(0.2f, 0.2f, 0.6f, 0.6f)).IsNearlyEqual(new Rectangle(20, 7.5f, 60, 60))); }
See Also