Namespace: DeltaEngine.Platforms.Tests
Assembly: DeltaEngine.Platforms.Tests (in DeltaEngine.Platforms.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Platforms.Tests (in DeltaEngine.Platforms.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Examples
[Test, Category("Slow")] public void TestDrawAreaWhenChangingOrientationToPortrait() { Resolve<Window>().ViewportPixelSize = new Size(480, 800); new Ellipse(new Rectangle(0.7f, 0.7f, 0.1f, 0.1f), Color.Red); RunAfterFirstFrame(() => { var screen = ScreenSpace.Current; Assert.AreEqual(typeof(QuadraticScreenSpace), screen.GetType()); var quadSize = screen.FromPixelSpace(new Vector2D(0, 0)); ArePointsNearlyEqual(new Vector2D(0.2f, 0f), quadSize); quadSize = screen.FromPixelSpace(new Vector2D(480, 800)); ArePointsNearlyEqual(new Vector2D(0.8f, 1), quadSize); var pixelSize = screen.ToPixelSpace(new Vector2D(0.2f, 0)); ArePointsNearlyEqual(Vector2D.Zero, pixelSize); pixelSize = screen.ToPixelSpace(new Vector2D(0.8f, 1)); ArePointsNearlyEqual(new Vector2D(480, 800), pixelSize); }); }
See Also