Class CoordUtils
This class provides methods for converting between different coordinate systems:
- World coordinates to world map screen positions
- World map screen positions to world coordinates
- Local coordinates to minimap screen positions
These utilities are essential for drawing overlays on the world map and minimap, as well as for click-to-walk functionality.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.runelite.api.PointlocalToMinimap(net.runelite.api.coords.LocalPoint point, int distance) Converts a local point to a screen position on the minimap.static net.runelite.api.coords.WorldPointworldMapToWorldPoint(net.runelite.api.Point point) Converts a screen position on the world map to world coordinates.static net.runelite.api.PointworldPointToWorldMap(net.runelite.api.coords.WorldPoint worldPoint) Converts a world point to a screen position on the world map.
-
Constructor Details
-
CoordUtils
public CoordUtils()
-
-
Method Details
-
worldPointToWorldMap
public static net.runelite.api.Point worldPointToWorldMap(net.runelite.api.coords.WorldPoint worldPoint) Converts a world point to a screen position on the world map.This method calculates where a world coordinate would appear on the currently visible world map interface. Returns
nullif the point is not visible on the world map or if the map is not open.- Parameters:
worldPoint- the world point to convert- Returns:
- the screen position on the world map, or
nullif not visible
-
worldMapToWorldPoint
public static net.runelite.api.coords.WorldPoint worldMapToWorldPoint(net.runelite.api.Point point) Converts a screen position on the world map to world coordinates.This method calculates which world coordinate corresponds to a given screen position on the world map interface.
- Parameters:
point- the screen position on the world map- Returns:
- the corresponding world point, or
nullif conversion fails
-
localToMinimap
@Nullable public static net.runelite.api.Point localToMinimap(net.runelite.api.coords.LocalPoint point, int distance) Converts a local point to a screen position on the minimap.This method calculates where a local coordinate would appear on the minimap, taking into account the player's position and the current camera angle.
Returns
nullif the point is outside the minimap's visible range or if the minimap widget is not visible.- Parameters:
point- the local point to convertdistance- the maximum distance squared from the player (points beyond this are not shown)- Returns:
- the screen position on the minimap, or
nullif not visible
-