Add WorldRenderer.Position for screen -> world conversion.

This commit is contained in:
Paul Chote
2013-09-24 18:33:48 +12:00
parent 27e4bbf1cb
commit 2e0e4b0bc5

View File

@@ -235,5 +235,10 @@ namespace OpenRA.Graphics
}
public float ScreenZPosition(WPos pos, int zOffset) { return (pos.Y + pos.Z + zOffset)*Game.CellSize/1024f; }
public WPos Position(int2 screenPx)
{
return new WPos(1024 * screenPx.X / Game.CellSize, 1024 * screenPx.Y / Game.CellSize, 0);
}
}
}