runelite-api: fix Tile location methods

This commit is contained in:
Adam
2017-11-24 18:00:59 -05:00
parent 75522cd758
commit 6f4fb6d8be
3 changed files with 35 additions and 3 deletions

View File

@@ -218,6 +218,22 @@ public class Perspective
return new Point(x, y);
}
public static Point regionToWorld(Client client, Point point)
{
int baseX = client.getBaseX();
int baseY = client.getBaseY();
int x = point.getX() + baseX;
int y = point.getY() + baseY;
return new Point(x, y);
}
public static Point regionToLocal(Client client, Point point)
{
int x = point.getX() << LOCAL_COORD_BITS;
int y = point.getY() << LOCAL_COORD_BITS;
return new Point(x, y);
}
/**
* Calculates a tile polygon from offset worldToScreen() points.
*

View File

@@ -47,5 +47,7 @@ public interface Tile
Point getWorldLocation();
Point getRegionLocation();
Point getLocalLocation();
}