ConstA button. onClick runs in the mod when the player presses it.
OptionalonClick: () => voidA text field. onSubmit runs on Enter; onChange when the field loses focus.
A progress bar from 0 to max (100 by default).
A slider. onChange gets the value when the player lets go.
OptionalonChange: (value: number) => voidAn on and off switch. onChange gets the new state.
OptionalonChange: (checked: boolean) => voidOpens a window in the game. It looks like any overlay app window: the player can move it in interactive mode (F10), and its position is saved.
import { game, ui } from "rednode";
const where = ui.text("Waiting for the game");
ui.window({
title: "Where am I",
children: [
where,
ui.button("Update", async () => {
const p = await game.player.position();
where.set({ text: `${p.x.toFixed(1)}, ${p.y.toFixed(1)}, ${p.z.toFixed(1)}` });
}),
],
});
Builds overlay windows from a Node mod.