LevelTests FetchMapCoordinatesOfClosestTileCenter Method Delta Engine Documentation

Namespace: DeltaEngine.GameLogic.Tests
Assembly: DeltaEngine.GameLogic.Tests (in DeltaEngine.GameLogic.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void FetchMapCoordinatesOfClosestTileCenter()
Examples

[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)));
}
See Also