Class PrivBotOverlayPanel<S>
java.lang.Object
net.runelite.client.ui.overlay.Overlay
net.runelite.client.ui.overlay.OverlayPanel
privbot.ui.overlay.PrivBotOverlayPanel<S>
- Type Parameters:
S- the tick-published state (seeSnapshot)
- All Implemented Interfaces:
net.runelite.client.ui.overlay.components.LayoutableRenderableEntity,net.runelite.client.ui.overlay.RenderableEntity
public abstract class PrivBotOverlayPanel<S>
extends net.runelite.client.ui.overlay.OverlayPanel
A themed HUD panel composed from a published state on every render.
Subclass and implement compose(Rows, Object), or build one with
PrivBotOverlays.panel(String). The panel applies OverlayTheme (card colour, width,
title) itself, renders nothing while hidden or while the state
supplier returns null, and never touches the client: everything it shows comes from S.
Each panel carries its own width, text scale and
background opacity; the background is re-applied from that opacity on every
frame, so a translucent panel stays translucent.
-
Field Summary
Fields inherited from class net.runelite.client.ui.overlay.OverlayPanel
panelComponentFields 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 TypeMethodDescriptionThe background this panel paints with (re-applied on every frame).protected abstract voidThe rows for this render; called only with a non-null state.opacity(int percent) Background opacity in percent (clamped 0..100); colour staysOverlayTheme.CARD_BG's.render(Graphics2D graphics) Render-thread entry: reads the visibility condition and the state, composes the rows and paints them.protected Sstate()The state for this render (the constructor's supplier unless a subclass supplies it).doubleThe text scale (1.0 = the client's overlay font).textScale(double scale) Text size relative to the client's overlay font (1.0 = unchanged).title()The title given to the constructor.protected StringThe title shown forstate; the constructor's title unless a subclass names one per state.visibleWhen(BooleanSupplier condition) Hide the panel whileconditionis false (typicallyplugin::isEnabled).intwidth()The panel width in pixels.width(int px) Sets the panel width in pixels (at least 80).Methods inherited from class net.runelite.client.ui.overlay.OverlayPanel
getPanelComponent, getPreferredColor, isClearChildren, isDynamicFont, setClearChildren, setDynamicFont, setPreferredColorMethods 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
-
PrivBotOverlayPanel
-
-
Method Details
-
compose
-
visibleWhen
Hide the panel whileconditionis false (typicallyplugin::isEnabled). -
width
Sets the panel width in pixels (at least 80). -
width
public int width()The panel width in pixels. -
opacity
Background opacity in percent (clamped 0..100); colour staysOverlayTheme.CARD_BG's. -
background
The background this panel paints with (re-applied on every frame). -
textScale
Text size relative to the client's overlay font (1.0 = unchanged). -
textScale
public double textScale()The text scale (1.0 = the client's overlay font). -
title
The title given to the constructor. -
state
The state for this render (the constructor's supplier unless a subclass supplies it). -
titleFor
-
render
Render-thread entry: reads the visibility condition and the state, composes the rows and paints them. Draws nothing while hidden, when the state is null, or when no row was added. Subclasses implementcompose(privbot.ui.overlay.Rows, S)rather than overriding this.- Specified by:
renderin interfacenet.runelite.client.ui.overlay.RenderableEntity- Overrides:
renderin classnet.runelite.client.ui.overlay.OverlayPanel
-