Class DrawUtils

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

public class DrawUtils extends Object
Utility class for drawing overlays and debug visualizations.

This class provides methods for rendering various game elements including:

  • Tiles and paths on the game screen
  • Points on the world map
  • Transport links for pathfinding
  • Collision map visualizations

These utilities are primarily used for debugging and overlay rendering.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Draws collision information using the global collision map.
    static void
    drawCollisions(Graphics2D graphics2D, CollisionMap collisionMap)
    Draws collision information for all visible tiles.
    static void
    drawOnMap(Graphics2D graphics, net.runelite.api.coords.WorldPoint point, Color color)
    Draws a world point on the world map.
    static void
    drawOnMap(Graphics2D graphics, Locatable locatable, Color color)
    Draws a locatable entity on the world map.
    static void
    drawOnMap(Graphics2D graphics, ITile tile, Color color)
    Draws a tile on the world map.
    static void
    drawPath(Graphics2D graphics2D, List<net.runelite.api.coords.WorldPoint> path)
    Draws a path on the game screen.
    static void
    Draws all transport links on the game screen.
    static void
    fillTile(Graphics2D graphics, net.runelite.api.coords.WorldPoint point, Color color)
    Fills a tile on the game screen with a color.
    static void
    outline(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint point, Graphics2D graphics2D, Color color)
    Outlines a tile on the game screen with a color.
    static void
    outline(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint point, Graphics2D graphics, Color color, String text)
    Outlines a tile on the game screen with a color and optional text.
    static net.runelite.api.Point
    tileCenter(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint b)
    Calculates the center point of a tile on screen.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DrawUtils

      public DrawUtils()
  • Method Details

    • drawOnMap

      public static void drawOnMap(Graphics2D graphics, Locatable locatable, Color color)
      Draws a locatable entity on the world map.
      Parameters:
      graphics - the graphics context to draw on
      locatable - the locatable entity to draw
      color - the color to use for drawing
    • drawOnMap

      public static void drawOnMap(Graphics2D graphics, ITile tile, Color color)
      Draws a tile on the world map.
      Parameters:
      graphics - the graphics context to draw on
      tile - the tile to draw
      color - the color to use for drawing
    • drawOnMap

      public static void drawOnMap(Graphics2D graphics, net.runelite.api.coords.WorldPoint point, Color color)
      Draws a world point on the world map.

      The point is drawn as a filled rectangle at the corresponding position on the world map interface.

      Parameters:
      graphics - the graphics context to draw on
      point - the world point to draw
      color - the color to use for drawing
    • drawTransports

      public static void drawTransports(Graphics2D graphics2D)
      Draws all transport links on the game screen.

      Transport links are shown as filled tiles with lines connecting source and destination points.

      Parameters:
      graphics2D - the graphics context to draw on
    • drawPath

      public static void drawPath(Graphics2D graphics2D, List<net.runelite.api.coords.WorldPoint> path)
      Draws a path on the game screen.

      Each point in the path is outlined and numbered sequentially.

      Parameters:
      graphics2D - the graphics context to draw on
      path - the list of world points forming the path
    • drawCollisions

      public static void drawCollisions(Graphics2D graphics2D, CollisionMap collisionMap)
      Draws collision information for all visible tiles.

      Blocked directions are shown as lines on the tile edges, and fully blocked tiles are filled with a semi-transparent color.

      Parameters:
      graphics2D - the graphics context to draw on
      collisionMap - the collision map containing movement restrictions
    • drawCollisions

      public static void drawCollisions(Graphics2D graphics2D)
      Draws collision information using the global collision map.
      Parameters:
      graphics2D - the graphics context to draw on
    • fillTile

      public static void fillTile(Graphics2D graphics, net.runelite.api.coords.WorldPoint point, Color color)
      Fills a tile on the game screen with a color.
      Parameters:
      graphics - the graphics context to draw on
      point - the world point of the tile to fill
      color - the fill color
    • tileCenter

      public static net.runelite.api.Point tileCenter(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint b)
      Calculates the center point of a tile on screen.
      Parameters:
      client - the game client
      b - the world point of the tile
      Returns:
      the screen center point, or null if tile is not visible
    • outline

      public static void outline(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint point, Graphics2D graphics2D, Color color)
      Outlines a tile on the game screen with a color.
      Parameters:
      client - the game client
      point - the world point of the tile
      graphics2D - the graphics context to draw on
      color - the outline color
    • outline

      public static void outline(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint point, Graphics2D graphics, Color color, String text)
      Outlines a tile on the game screen with a color and optional text.

      The tile is drawn with a colored outline and a semi-transparent fill. If text is provided, it is drawn centered on the tile.

      Parameters:
      client - the game client
      point - the world point of the tile
      graphics - the graphics context to draw on
      color - the outline color
      text - optional text to draw on the tile (can be null)