Some rephrasing

This commit is contained in:
Simon Holmberg
2012-09-27 23:06:37 +02:00
parent 12cd5447c8
commit a6117af112
3 changed files with 4 additions and 4 deletions
@@ -39,7 +39,7 @@ namespace DepthsBelow.Component
public Vector2 ToScreen() public Vector2 ToScreen()
{ {
return Grid.GridToScreen(Position); return Grid.GridToWorld(Position);
} }
} }
} }
@@ -44,7 +44,7 @@ namespace DepthsBelow.Component
public Point ToGrid() public Point ToGrid()
{ {
return Grid.ScreenToGrid(Position); return Grid.WorldToGrid(Position);
} }
} }
} }
+2 -2
View File
@@ -7,12 +7,12 @@ namespace DepthsBelow
{ {
public const int TileSize = 32; public const int TileSize = 32;
public static Vector2 GridToScreen(Point gridPos) public static Vector2 GridToWorld(Point gridPos)
{ {
return new Vector2(gridPos.X * TileSize, gridPos.Y * TileSize); return new Vector2(gridPos.X * TileSize, gridPos.Y * TileSize);
} }
public static Point ScreenToGrid(Vector2 screenPos) public static Point WorldToGrid(Vector2 screenPos)
{ {
return new Point( return new Point(
(int)Math.Floor(screenPos.X / TileSize), (int)Math.Floor(screenPos.X / TileSize),