Class DefaultPaint

java.lang.Object
net.runelite.client.ui.overlay.Overlay
net.storm.sdk.script.paint.DefaultPaint
All Implemented Interfaces:
net.runelite.client.ui.overlay.components.LayoutableRenderableEntity, net.runelite.client.ui.overlay.RenderableEntity

public class DefaultPaint extends net.runelite.client.ui.overlay.Overlay
A default paint overlay implementation for displaying script statistics.

This class provides a convenient way to display runtime statistics in a panel overlay on the game screen. It supports:

  • Custom key-value statistics
  • Automatic skill experience tracking with hourly rates
  • Header sections for organizing statistics
  • Custom renderable entities for advanced visualizations
  • Separators for visual grouping

The paint is positioned dynamically above widgets and can be enabled/disabled at runtime.

See Also:
  • Field Summary

    Fields inherited from class net.runelite.client.ui.overlay.Overlay

    PRIORITY_DEFAULT, PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_MED
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new DefaultPaint overlay.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an empty separator row to the statistics display.
    void
    Clears all statistics and custom overlay renderers.
    void
    remove(net.runelite.client.ui.overlay.RenderableEntity renderableEntity)
    Removes a specific renderable entity from the overlay.
    render(Graphics2D graphics)
    Renders all overlay components.
    void
    Sets a header text in the statistics display.
    void
    submit(String key, Supplier<String> supplier)
    Submits a new statistic to be displayed in the paint.
    void
    submit(net.runelite.client.ui.overlay.RenderableEntity renderableEntity)
    Submits a custom renderable entity to be drawn with the overlay.
    void
    trackSkill(net.runelite.api.Skill skill, boolean trackLevels)
    Tracks experience gained for a specific skill.

    Methods inherited from class net.runelite.client.ui.overlay.Overlay

    addMenuEntry, addMenuEntry, drawAfterInterface, drawAfterLayer, drawAfterLayer, drawAfterLayer, getBounds, getDrawHooks, getLayer, getMenuEntries, getMinimumSize, getName, getParentBounds, getPlugin, getPosition, getPreferredLocation, getPreferredPosition, getPreferredSize, getPriority, isDragTargetable, isMovable, isResettable, isResizable, isSnappable, onDrag, onMouseOver, removeMenuEntry, revalidate, setBounds, setDragTargetable, setLayer, setMinimumSize, setMovable, setPosition, setPreferredLocation, setPreferredPosition, setPreferredSize, setPriority, setPriority, setResettable, setResizable, setSnappable

    Methods inherited from class java.lang.Object

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

    • DefaultPaint

      public DefaultPaint()
      Constructs a new DefaultPaint overlay.

      Initializes the overlay with dynamic positioning above widgets, priority of 1.0, and adds the default tracker renderer.

  • Method Details

    • render

      public Dimension render(Graphics2D graphics)
      Renders all overlay components.
      Parameters:
      graphics - the graphics context to render to
      Returns:
      null as this overlay manages its own rendering
    • submit

      public void submit(String key, Supplier<String> supplier)
      Submits a new statistic to be displayed in the paint.
      Parameters:
      key - the label/key for the statistic
      supplier - a supplier that provides the current value as a string
    • submit

      public void submit(net.runelite.client.ui.overlay.RenderableEntity renderableEntity)
      Submits a custom renderable entity to be drawn with the overlay.
      Parameters:
      renderableEntity - the renderable entity to add
    • addSeparator

      public void addSeparator()
      Adds an empty separator row to the statistics display.

      Useful for visually grouping related statistics.

    • clear

      public void clear()
      Clears all statistics and custom overlay renderers.
    • remove

      public void remove(net.runelite.client.ui.overlay.RenderableEntity renderableEntity)
      Removes a specific renderable entity from the overlay.
      Parameters:
      renderableEntity - the renderable entity to remove
    • trackSkill

      public void trackSkill(net.runelite.api.Skill skill, boolean trackLevels)
      Tracks experience gained for a specific skill.

      Adds a statistic that displays the experience gained along with the hourly rate. Optionally tracks levels gained as well.

      Parameters:
      skill - the skill to track
      trackLevels - whether to also track levels gained
    • setHeader

      public void setHeader(String text)
      Sets a header text in the statistics display.

      Headers are displayed as title components and are useful for organizing statistics into sections.

      Parameters:
      text - the header text to display