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 EdgesAfterPanning() { Assert.AreEqual(16 / 9.0f, window.ViewportPixelSize.AspectRatio); var camera = new Camera2DScreenSpace(window) { LookAt = new Vector2D(0.75f, 0.6f) }; Assert.IsTrue(camera.TopLeft.IsNearlyEqual(new Vector2D(0.25f, 0.31875f))); Assert.IsTrue(camera.BottomRight.IsNearlyEqual(new Vector2D(1.25f, 0.88125f))); Assert.AreEqual(0.31875f, camera.Top, 0.0001f); Assert.AreEqual(0.25f, camera.Left, 0.0001f); Assert.AreEqual(0.88125f, camera.Bottom, 0.0001f); Assert.AreEqual(1.25f, camera.Right, 0.0001f); }
[Test] public void EdgesAfterPanningAndZooming() { Assert.AreEqual(16 / 9.0f, window.ViewportPixelSize.AspectRatio); var camera = new Camera2DScreenSpace(window) { LookAt = new Vector2D(0.4f, 0.5f), Zoom = 0.5f }; Assert.AreEqual(new Vector2D(-0.6f, -0.0625f), camera.TopLeft); Assert.AreEqual(new Vector2D(1.4f, 1.0625f), camera.BottomRight); Assert.AreEqual(-0.0625f, camera.Top, 0.0001f); Assert.AreEqual(-0.6f, camera.Left, 0.0001f); Assert.AreEqual(1.0625f, camera.Bottom, 0.0001f); Assert.AreEqual(1.4f, camera.Right, 0.0001f); }
See Also