Package net.storm.sdk.utils
Class DrawUtils
java.lang.Object
net.storm.sdk.utils.DrawUtils
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddrawCollisions(Graphics2D graphics2D) Draws collision information using the global collision map.static voiddrawCollisions(Graphics2D graphics2D, CollisionMap collisionMap) Draws collision information for all visible tiles.static voiddrawOnMap(Graphics2D graphics, net.runelite.api.coords.WorldPoint point, Color color) Draws a world point on the world map.static voiddrawOnMap(Graphics2D graphics, Locatable locatable, Color color) Draws a locatable entity on the world map.static voiddrawOnMap(Graphics2D graphics, ITile tile, Color color) Draws a tile on the world map.static voiddrawPath(Graphics2D graphics2D, List<net.runelite.api.coords.WorldPoint> path) Draws a path on the game screen.static voiddrawTransports(Graphics2D graphics2D) Draws all transport links on the game screen.static voidfillTile(Graphics2D graphics, net.runelite.api.coords.WorldPoint point, Color color) Fills a tile on the game screen with a color.static voidoutline(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 voidoutline(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.PointtileCenter(net.runelite.api.Client client, net.runelite.api.coords.WorldPoint b) Calculates the center point of a tile on screen.
-
Constructor Details
-
DrawUtils
public DrawUtils()
-
-
Method Details
-
drawOnMap
Draws a locatable entity on the world map.- Parameters:
graphics- the graphics context to draw onlocatable- the locatable entity to drawcolor- the color to use for drawing
-
drawOnMap
Draws a tile on the world map.- Parameters:
graphics- the graphics context to draw ontile- the tile to drawcolor- 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 onpoint- the world point to drawcolor- the color to use for drawing
-
drawTransports
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
Draws a path on the game screen.Each point in the path is outlined and numbered sequentially.
- Parameters:
graphics2D- the graphics context to draw onpath- the list of world points forming the path
-
drawCollisions
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 oncollisionMap- the collision map containing movement restrictions
-
drawCollisions
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 onpoint- the world point of the tile to fillcolor- 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 clientb- the world point of the tile- Returns:
- the screen center point, or
nullif 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 clientpoint- the world point of the tilegraphics2D- the graphics context to draw oncolor- 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 clientpoint- the world point of the tilegraphics- the graphics context to draw oncolor- the outline colortext- optional text to draw on the tile (can benull)
-