Namespace: DeltaEngine.GameLogic
Assembly: DeltaEngine.GameLogic (in DeltaEngine.GameLogic.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.GameLogic.Tests.LevelTests
5 unit tests call DeltaEngine.GameLogic.Level.RenderIn3D
Assembly: DeltaEngine.GameLogic (in DeltaEngine.GameLogic.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: BooleanRemarks
Examples
[Test, CloseAfterFirstFrame] public void ConvertMapCoordinatesToWorldCoordinates() { var level = new Level(new Size(3, 5)); level.RenderIn3D = true; Assert.AreEqual(new Vector2D(0, 0), level.GetWorldCoordinates(new Vector2D(1, 2))); Assert.AreEqual(new Vector2D(-1, 2), level.GetWorldCoordinates(new Vector2D(0, 0))); Assert.AreEqual(new Vector2D(1, 2), level.GetWorldCoordinates(new Vector2D(2, 0))); Assert.AreEqual(new Vector2D(-1, -2), level.GetWorldCoordinates(new Vector2D(0, 4))); Assert.AreEqual(new Vector2D(1, -2), level.GetWorldCoordinates(new Vector2D(2, 4))); }
[Test, CloseAfterFirstFrame] public void FetchMapCoordinatesOfClosestTileCenter() { var level = new Level(new Size(3, 3)); level.RenderIn3D = true; Assert.AreEqual(new Vector2D(0, 0), level.GetWorldCoordinates(new Vector2D(1.1f, 1.1f))); Assert.AreEqual(new Vector2D(0, 0), level.GetWorldCoordinates(new Vector2D(1.1f, 1.9f))); Assert.AreEqual(new Vector2D(0, 0), level.GetWorldCoordinates(new Vector2D(1.9f, 1.9f))); Assert.AreEqual(new Vector2D(0, 0), level.GetWorldCoordinates(new Vector2D(1.9f, 1.1f))); }
[Test, CloseAfterFirstFrame] public void ConvertWorldCoordinatesToMapCoordinates() { var level = new Level(new Size(3, 5)); level.RenderIn3D = true; Assert.AreEqual(new Vector2D(1, 2), level.GetMapCoordinates(new Vector2D(0, 0))); Assert.AreEqual(new Vector2D(0, 0), level.GetMapCoordinates(new Vector2D(-1, 2))); Assert.AreEqual(new Vector2D(2, 0), level.GetMapCoordinates(new Vector2D(1, 2))); Assert.AreEqual(new Vector2D(0, 4), level.GetMapCoordinates(new Vector2D(-1, -2))); Assert.AreEqual(new Vector2D(2, 4), level.GetMapCoordinates(new Vector2D(1, -2))); }
See Also