Пример #1
0
		public void SquareWindowWithPixelSpace()
		{
			var screen = new PixelScreenSpace(window);
			Assert.AreEqual(Vector2D.Zero, screen.TopLeft);
			Assert.AreEqual(window.ViewportPixelSize, (Size)screen.BottomRight);
			Assert.AreEqual(new Rectangle(Vector2D.Zero, window.TotalPixelSize), screen.Viewport);
			Assert.AreEqual(new Vector2D(100, 100), screen.FromPixelSpace(new Vector2D(100, 100)));
			Assert.AreEqual(new Rectangle(10, 10, 80, 80),
				screen.FromPixelSpace(new Rectangle(10, 10, 80, 80)));
			window.CloseAfterFrame();
		}
Пример #2
0
		public void SquareWindow()
		{
			var pixelScreen = new PixelScreenSpace(window);
			window.ViewportPixelSize = new Size(100, 100);
			Assert.AreEqual(Vector2D.Zero, pixelScreen.TopLeft);
			Assert.AreEqual(new Vector2D(100, 100), pixelScreen.BottomRight);
			Assert.AreEqual(new Rectangle(0, 0, 100, 100), pixelScreen.Viewport);
			Assert.AreEqual(new Vector2D(100, 100), pixelScreen.FromPixelSpace(new Vector2D(100, 100)));
			Assert.AreEqual(new Vector2D(50, 50), pixelScreen.FromPixelSpace(new Vector2D(50, 50)));
		}