Class SceneCanvas
java.lang.Object
privbot.ui.overlay.SceneCanvas
The scene-drawing primitives every tile overlay used to hand-roll, over one
SceneProjection.
Handed to PrivBotSceneOverlay.draw(SceneCanvas, Object) for one render; it draws with
the overlay's Graphics2D and never reads the client except through the projection.
-
Method Summary
Modifier and TypeMethodDescriptionEvery tile ofarea(its plane is ignored; the current plane projects).A tick countdown on a tile: fill fromramp, the number shadowed on top.A countdown tile coloured byramp(ticksLeft)with customtexton top.graphics()The overlay's graphics, for drawing the primitives here do not cover.Shadowed text above an actor (heightOffsetin scene units; the actor's height works).Shadowed text centred over a tile at ground level.Shadowed text centred over a tile, raisedheightOffsetscene units; off-screen draws nothing.A translucent box sized to its lines, drawn at a canvas point (debug boxes over NPC heads).A 2 px line between two tile centres at ground level; nothing if either end is off-screen.Convenience forlabelBox(int, int, List, Color)callers building lines.Outline an actor (convex hull where available, its tile otherwise).A polyline through tile centres; unprojectable tiles break the line rather than skew it.progressBar(int x, int y, int w, int h, double fraction, Color color) A rounded progress bar in canvas space.The projection tiles and points go through.shadowText(int x, int y, String text, Color color) Text with a 1 px black drop shadow, the way every plugin drew it.Fill a tile withcoloratOverlayTheme.TILE_ALPHAand outline it solid.Fill and outline a tile with explicit colours; either may be null to skip it.Fill the tile under an actor.tile(WorldPoint, Color)for each tile; null draws nothing.
-
Method Details
-
graphics
The overlay's graphics, for drawing the primitives here do not cover. -
projection
The projection tiles and points go through. -
tile
Fill a tile withcoloratOverlayTheme.TILE_ALPHAand outline it solid. -
tile
Fill and outline a tile with explicit colours; either may be null to skip it. Off-screen tiles draw nothing. -
tiles
tile(WorldPoint, Color)for each tile; null draws nothing. -
area
Every tile ofarea(its plane is ignored; the current plane projects). -
outline
Outline an actor (convex hull where available, its tile otherwise).The actor methods read the live actor at render time. Prefer drawing a
WorldPointcopied into the snapshot when the actor may have despawned. -
tileOf
Fill the tile under an actor. -
label
Shadowed text centred over a tile at ground level. -
label
public SceneCanvas label(net.runelite.api.coords.WorldPoint tile, String text, Color color, int heightOffset) Shadowed text centred over a tile, raisedheightOffsetscene units; off-screen draws nothing. -
label
Shadowed text above an actor (heightOffsetin scene units; the actor's height works). -
countdown
public SceneCanvas countdown(net.runelite.api.coords.WorldPoint tile, int ticksLeft, ColorRamp ramp) A tick countdown on a tile: fill fromramp, the number shadowed on top. -
countdown
public SceneCanvas countdown(net.runelite.api.coords.WorldPoint tile, String text, int ticksLeft, ColorRamp ramp) A countdown tile coloured byramp(ticksLeft)with customtexton top. -
shadowText
Text with a 1 px black drop shadow, the way every plugin drew it. -
line
public SceneCanvas line(net.runelite.api.coords.WorldPoint a, net.runelite.api.coords.WorldPoint b, Color color) A 2 px line between two tile centres at ground level; nothing if either end is off-screen. -
path
A polyline through tile centres; unprojectable tiles break the line rather than skew it. -
labelBox
A translucent box sized to its lines, drawn at a canvas point (debug boxes over NPC heads). -
progressBar
A rounded progress bar in canvas space. -
lines
Convenience forlabelBox(int, int, List, Color)callers building lines.
-