Package net.storm.sdk.script.paint
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an empty separator row to the statistics display.voidclear()Clears all statistics and custom overlay renderers.voidremove(net.runelite.client.ui.overlay.RenderableEntity renderableEntity) Removes a specific renderable entity from the overlay.render(Graphics2D graphics) Renders all overlay components.voidSets a header text in the statistics display.voidSubmits a new statistic to be displayed in the paint.voidsubmit(net.runelite.client.ui.overlay.RenderableEntity renderableEntity) Submits a custom renderable entity to be drawn with the overlay.voidtrackSkill(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
-
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
Renders all overlay components.- Parameters:
graphics- the graphics context to render to- Returns:
nullas this overlay manages its own rendering
-
submit
Submits a new statistic to be displayed in the paint.- Parameters:
key- the label/key for the statisticsupplier- 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 tracktrackLevels- whether to also track levels gained
-
setHeader
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
-