Level GetMapCoordinates Method Delta Engine Documentation

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

public Vector2D GetMapCoordinates(
	Vector2D worldCoordinates
)

Return Value

Type: Vector2D
Remarks

Tests: DeltaEngine.GameLogic.Tests.LevelTests
Examples

1 unit tests call DeltaEngine.GameLogic.Level.GetMapCoordinates(DeltaEngine.Datatypes.Vector2D)
[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