Class PrivBotSceneOverlay<S>

java.lang.Object
net.runelite.client.ui.overlay.Overlay
privbot.ui.overlay.PrivBotSceneOverlay<S>
Type Parameters:
S - the tick-published state (see Snapshot)
All Implemented Interfaces:
net.runelite.client.ui.overlay.components.LayoutableRenderableEntity, net.runelite.client.ui.overlay.RenderableEntity

public abstract class PrivBotSceneOverlay<S> extends net.runelite.client.ui.overlay.Overlay
A scene overlay (tiles, outlines, labels, paths) drawn from a published state on every render.

Subclass and implement draw(SceneCanvas, Object), or build one with PrivBotOverlays.scene(Client). Projection goes through SceneProjection, so the same code draws on RuneLite-API servers and on Impact and Elorin.

  • 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
    Modifier
    Constructor
    Description
    protected
    PrivBotSceneOverlay(net.runelite.api.Client client, Supplier<S> state)
    Projects through SceneProjection.of(Client); state is read on the render thread.
    protected
    Uses projection; the overlay is dynamic, above the scene, low priority.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    draw(SceneCanvas canvas, S state)
    Draw this render's scene; called only with a non-null state.
    The projection this overlay draws with.
    render(Graphics2D graphics)
    Render-thread entry: checks visibility, reads the state and calls draw(privbot.ui.overlay.SceneCanvas, S) with a fresh SceneCanvas.
    Draw only while condition is true (null = always).

    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

    • PrivBotSceneOverlay

      protected PrivBotSceneOverlay(net.runelite.api.Client client, Supplier<S> state)
      Projects through SceneProjection.of(Client); state is read on the render thread.
    • PrivBotSceneOverlay

      protected PrivBotSceneOverlay(SceneProjection projection, Supplier<S> state)
      Uses projection; the overlay is dynamic, above the scene, low priority.
  • Method Details

    • draw

      protected abstract void draw(SceneCanvas canvas, S state)
      Draw this render's scene; called only with a non-null state.
    • visibleWhen

      public PrivBotSceneOverlay<S> visibleWhen(BooleanSupplier condition)
      Draw only while condition is true (null = always). It runs on the render thread, so it must read published state only.
    • projection

      public SceneProjection projection()
      The projection this overlay draws with.
    • render

      public Dimension render(Graphics2D graphics)
      Render-thread entry: checks visibility, reads the state and calls draw(privbot.ui.overlay.SceneCanvas, S) with a fresh SceneCanvas. Draws nothing when hidden or when the state is null; an exception in draw drops that frame only. Always returns null (dynamic overlay).