On-screen drawing: text, markers, notifications and help prompts.

Everything that draws (drawText, drawText3d, drawMarker, drawRect) lasts exactly one frame, which is how the game's immediate-mode renderer works. To keep something on screen, draw it every frame:

Thread.everyFrame(() -> {
    Ui.drawText3d(shopPosition, "Hardware Store", {scale: 0.4});
});

Notifications and help prompts are different — those are fire-and-forget and persist on their own.

Static methods

@:value({ rotate : false, faceCamera : false, bobbing : false, type : 1 })staticdrawMarker(position:Vector3, type:Int = 1, ?scale:Vector3, ?colour:Rgba, bobbing:Bool = false, faceCamera:Bool = false, rotate:Bool = false):Void

Draws one of the game's 3D markers.

Parameters:

type

1 is the classic vertical cylinder, 27 a flat ring, 20 a downward chevron.

bobbing

Whether the marker floats up and down.

faceCamera

Whether it always turns to face the player.

staticinlinedrawRect(position:Vector2, size:Vector2, colour:Rgba):Void

Draws a filled rectangle in screen space, centred on position.

staticdrawText(text:String, position:Vector2, ?style:Null<TextStyle>):Void

Draws text in screen space. Coordinates are 0..1 fractions of the screen, with (0, 0) at the top left.

staticdrawText3d(position:Vector3, text:String, ?style:Null<TextStyle>):Void

Draws text at a world position, scaled so it shrinks with distance.

Returns without drawing when the position is off-screen, so it is safe to call unconditionally in a per-frame loop.

staticnotify(message:String, ?backgroundColour:Int):Void

Posts a notification to the feed at the top left.

Supports the game's markup: ~r~ red, ~g~ green, ~b~ blue, ~w~ white, ~h~ bold, ~n~ newline.

@:value({ beep : false })staticshowHelp(message:String, beep:Bool = false):Void

Shows the instructional prompt box in the top left for one frame.

Call it every frame while the prompt should be visible. Control names can be embedded and are rendered as the player's actual binding: "Press ~INPUT_CONTEXT~ to open".