Add some world-coordinate helpers.

This commit is contained in:
Paul Chote
2013-07-20 13:06:13 +12:00
parent 8751d29a9a
commit 1dfc4837d4
3 changed files with 27 additions and 1 deletions

View File

@@ -41,7 +41,9 @@ namespace OpenRA
public int2 ToInt2() { return new int2(X, Y); }
public PPos ToPPos() { return new PPos(Game.CellSize * X, Game.CellSize * Y); }
public WPos CenterPosition { get { return new WPos(1024*X + 512, 1024*Y + 512, 0); } }
public WPos CenterPosition { get { return new WPos(1024 * X + 512, 1024 * Y + 512, 0); } }
public WPos TopLeft { get { return new WPos(1024 * X, 1024 * Y, 0); } }
public WPos BottomRight { get { return new WPos(1024 * X + 1023, 1024 * Y + 1023, 0); } }
public CPos Clamp(Rectangle r)
{