ConstThe game's drawn widgets under a point on screen, on every active layer, the smallest box
first (the most particular widget; then the deepest), leaving out what is not drawn (its or its
parents' opacity is 0):
what an inspector's Pick finds. x and y are in the game's ink pixels (the layers'
size). Reads only.
A bar: a track and a fill from its left edge, value full (0 to 1), or bound to a game
value the plugin reads every frame.
Every drawn widget of the game with a box on screen, on every active layer, the smallest first, in one call (about 7 ms for 1,600 widgets in game 2.5). A page that highlights what is under the cursor reads these once and tests each mouse move itself, instead of asking the game on every move. Boxes are in ink pixels, as ink.at's. Reads only.
A free canvas: its children sit by their anchor, x and y.
Checks ink markup without putting anything on the game's UI, as ink.parse would
read it: answers null when it reads, or the first InkMarkupError, with its line and
column. Give handlers (the names its on... attributes may use) to check those too. An
editor checks as the modder types with it.
Optionalhandlers: Record<string, unknown> | string[]Optionalfile: stringChildren one under the other, gap apart.
One of the game's widgets in full: its class and parents' classes, path, box, controllers,
where it came from (layer, HUD entry, library file hash) and every property. ref is an
api reference to it, for calling its methods. Reads only.
The game's own ink layers (needs Codeware), in their order, each with its window. The HUD
layer also lists its entries: each HUD piece the game spawned, with its root widget, its
game controller and the .inkwidget file it came from (a path hash). Reads only.
A column (or direction: "row") of one node per item. Give it new items with set:
new keys are added at their place, gone ones removed, moved ones moved, and the others
patched, so only what changed goes to the game.
Reads an ink markup file (.ink.html) and puts it on the game's UI, as
ink.parse does. A relative path starts at the package's folder. Mistakes name the
file, line and column.
Optionalhandlers: Record<string, unknown>Optionaldata: Record<string, unknown>The tags ink markup knows, with the attributes each takes: for an editor's completion.
Puts a tree on a layer of the game's UI. Layers: "hud", which hides with the HUD.
REDnode builds it again after a save load, and removes it when the mod stops.
Puts ink markup on the game's UI: the tags of this module written as HTML, their props as
attributes. The top of the markup holds <mount> tags (layer, anchor, x, y).
canvas, column, row (also vbox, hbox), text, rect, circle,
image, bar, list, and widget class="inkBorder" for any ink class, whose
capitalized attributes are its methods. Attributes are the props by name;
text-align is textAlign. margin and pad take one number or four.<text>...</text>, or text="...". LocKey#... and key show the
game's own text.{name} in text or an attribute reads the named data, {name.field} a
field of it. An attribute that is one {name} alone takes the value as it is (a
number, true). {{ and }} are the characters. No expressions.<list items="contracts" key="id"> holds the one tag each item gets; inside
it {name} reads the item's field first, {.} is the item itself and {$index} its
place.onclick="track" names a function of handlers, checked now. Input on
ink comes with phase I3: until then no event fires.A mistake throws an InkMarkupError with its line and column.
The markup.
Optionalhandlers: Record<string, unknown>
The functions its on... attributes name: a module (import * as handlers from "./bounty.mjs") or an object.
Optionaldata: Record<string, unknown>
The named data it reads, changed later with InkView.set.
const board = ink.parse(`
<mount layer="hud" anchor="top-right" x="-40" y="120">
<column gap="6">
<text style="title">Bounty board</text>
<list items="contracts" key="id" gap="4">
<row gap="12">
<text style="body">{name}</text>
<text style="value">{reward} €$</text>
</row>
</list>
</column>
</mount>`, {}, { contracts: [] });
board.set({ contracts: [{ id: 1, name: "Watson", reward: 1500 }] });
Reads a tree of the game's own widgets in one call: a layer's window, a widget by its id
from an earlier read, or an api reference. Each node has its class, name, visibility,
box on screen, controller and text; children stops at depth or max nodes (count
says how many it has). Reads only.
Optionalboxes?: booleanOptionaldepth?: numberOptionalmax?: numberOptionalprops?: booleanEach node's layout and look as well (props and drawn), with texts whole: what ink markup needs to copy it. Needs REDnode 0.56.0.
Puts back what ink.try changed: every widget the package tried, one widget, or one of its properties. Answers how many were put back, and how many the game had removed meanwhile (a save load rebuilds the HUD). Needs REDnode 0.56.0.
Optionalid: stringOptionalprop: InkTryPropChildren side by side, gap apart.
A line of text, in the game's Rajdhani by default.
What the package has tried and not put back yet, with each value before the first try. Needs REDnode 0.56.0.
Tries a change on one of the game's own widgets, live, to find what controls a look: its
visible, opacity, tint, size, margin, padding, translation (x and y), or a
text's text and fontSize. The first try of a property keeps the value it had, and
ink.reset puts it back; REDnode puts everything back when the package stops, so a
try is never kept. Answers the value before the first try and the value now. Only for a
package the player allowed admin (the UI Workbench's Try). Needs REDnode 0.56.0.
import { game, ink } from "rednode";
const where = ink.text("", { size: 28, color: "cyan" });
ink.mount("hud", { anchor: "top-right", x: -40, y: 120 },
ink.column({ gap: 4 }, ink.text("REDnode", { size: 20 }), where));
setInterval(async () => {
const p = await game.player.position();
where.set({ text: `${p.x.toFixed(1)} ${p.y.toFixed(1)} ${p.z.toFixed(1)}` });
}, 250);
The game's own UI, drawn by the game. Needs Codeware.