Class CoordUtils

java.lang.Object
net.storm.sdk.utils.CoordUtils

public class CoordUtils extends Object
Utility class for coordinate transformations and conversions.

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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static net.runelite.api.coords.WorldPoint
    worldMapToWorldPoint(net.runelite.api.Point point)
    Converts a screen position on the world map to world coordinates.
    static net.runelite.api.Point
    worldPointToWorldMap(net.runelite.api.coords.WorldPoint worldPoint)
    Converts a world point to a screen position on the world map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 null if 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 null if 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 null if 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 null if the point is outside the minimap's visible range or if the minimap widget is not visible.

      Parameters:
      point - the local point to convert
      distance - the maximum distance squared from the player (points beyond this are not shown)
      Returns:
      the screen position on the minimap, or null if not visible