AI tools: UI, text and languages
Game UI, HUD, menus, strings and languages. 9 tools. You see every step your AI takes and can undo any of them.
add_ui_screen core
Create the generic game UI kit or add/replace one data-driven screen in UI/game.ui.json, or edit one widget's text, rect, size or alignment (or one screen's title/subtitle) in place. Screens use safe-area normalized rects and message hooks; previous layouts are backed up. New 2D scenes get hearts, coins and objective; preset selects 2d or shooter. Use scene to save a separate UI/Scenes/<scene>.ui.json; omit scene for the project default. Existing layouts are preserved.
| Argument | Type | What it does |
|---|---|---|
controls | list of object | Optional game key bindings: id,logicalKey,defaultKey; rebind widgets reference their id. |
edit | object | Change one widget or one screen's words in the saved layout without rewriting the screen: {screen, widget (an id from ui_report; leave out to edit the screen), text, rect {x,y,width,height}, size, align, remove: true} or {screen, title, subtitle} ("" removes the subtitle). |
fog | boolean | template map: fog of war (unseen ground darkened, enemies only in sight). |
items | list of object | Optional item definitions: id,title,description,useMessage,consumed,icon (relative to Assets). |
preset | 2d / shooter | New layouts default to 2d when the scene has a 2D camera/body. 2d provides hearts, coins and objective. |
scene | string | Optional scene name for an independent layout; omit for the project default. |
screen | object | {id,title,modal,style?,widgets:[{id,kind,rect:{x,y,width,height},text?,binding?,action?}]}. A bound text widget shows its value; put {value} in its text to keep a label ("Lap: {value}"). Text never shrinks below one readable line. Widgets also take: anchor (top_left..bottom_right: keeps its size on wide screens), enter (fade, slide_up/down/left/right, pop) with delay and duration, idle (pulse, bob, blink), sound and focusSound (sound names, e.g. imported Sounds), data (sent with a hook: button), nav {up,down,left,right: widget id} and order (controller focus), font (title, body, name, numbers), textColor, align (left, center, right), icon/slice/border (any Assets picture, nine-sliced). |
template | string | main, pause, settings, audio, graphics, controls, inventory, dialogue, win, game_over, loading, hud, scores (a high-score table: the top 10 from game.scores, the new entry lit, Back), or map (the full-screen world map: the scene's bake_world_map picture when baked, a Map row on the pause menu) |
title | string |
bind_hud
Bind an existing HUD widget to the real HUD field or script UI value. The default Health/Stamina/Ammo/Action fields reuse gameplay; no separate stats are created.
| Argument | Type | What it does |
|---|---|---|
maximum | number | |
scene | string | Optional scene name for an independent layout; omit for the project default. |
screen | string | |
source required | string | |
widget required | string |
dialogue
In Play: run a branching conversation like the player. `talk` starts Dialogue/<id>.dialogue.json (`start` another node; `with` the speaking object's name, so its voice lines lip-sync); `choose` picks the n-th card shown (0 first); `next` continues past a line; `stop` ends it. Answers what's on screen now (speaker, line, cards) and the backlog. Same as scripts' game.talk and game.dialogue.
| Argument | Type | What it does |
|---|---|---|
choose | integer | |
next | boolean | |
start | string | |
stop | boolean | |
talk | string | Conversation id to start. |
with | string | The speaking object's name. |
dialogue_paths
Every way through one conversation (Dialogue/<id>.dialogue.json), up to `limit` (default 64): the nodes shown, the choice taken at each choice node (node>2 = its second card), what the path needs (conditions taken true; !x taken false), and how it ends (end, loops to a node, or a missing node). Use it to test a conversation's branches before playing, and to see which flags, items and quest states reach each ending.
| Argument | Type | What it does |
|---|---|---|
id required | string | |
limit | integer |
strings_extract
Every word this game shows, to translate it: UI layouts (menus, HUD labels, buttons), conversations, quests, cutscenes, items and shops, and the words scripts send to the screen (game.say lines, game.hud labels, dialogue text, objectives, game.t keys). Each text once, with where it is used and the {placeholders} a translation must keep. Give `language` to list only what that language's table (Assets/Strings/<code>.json) still lacks; then translate them and send them with strings_set. Engine stock words (stock: true) are already translated for the engine's languages. Pages of `limit` (default 300) from `offset`. Codes: es, pt (pt-BR), fr, de, it, nl, pl, tr, vi, id, ru, uk, el, ja, ko, zh-Hans, zh-Hant, ar, he, hi, th (any BCP 47 code works). The engine's own menu words already come in es, pt, fr, de, ru, ja, ko, zh-Hans and ar.
| Argument | Type | What it does |
|---|---|---|
include_stock | boolean | Also list engine stock words (default: only for a language the engine doesn't ship). |
kind | ui / dialogue / quest / cutscene / item / sequence / script / key … | |
language | string | Only the texts this language still lacks. |
limit | integer | |
offset | integer |
strings_set
Write translations into the game's table for `language` (Assets/Strings/<code>.json), merged with what is there (`replace` starts the file over). `strings` maps each text as the game shows it (or a key a script asks for with game.t / a widget's "@key") to its translation: a string, or plural forms { one, few, many, other... } for counted texts. Keep every {placeholder} exactly. `fonts` gives this language its own face per role ({ "title": "Fonts/NotoSerifJP/NotoSerifJP-Bold.otf" }); without one, a face that lacks the letters falls back to the system face for the language. `remove` deletes entries. The game in Play changes language at once when `show` is true (otherwise the player picks it in Settings > Language). Answers with what is still missing and any placeholder problems. Codes: es, pt (pt-BR), fr, de, it, nl, pl, tr, vi, id, ru, uk, el, ja, ko, zh-Hans, zh-Hant, ar, he, hi, th (any BCP 47 code works). The engine's own menu words already come in es, pt, fr, de, ru, ja, ko, zh-Hans and ar.
| Argument | Type | What it does |
|---|---|---|
fonts | object | Role (title, body, name, numbers) → a project font file with this language's letters. |
language required | string | |
remove | list of string | |
replace | boolean | |
show | boolean | Switch the game in Play to this language now. |
strings | object | Text or key → translation (string, or { one, other, ... }). |
ui_input
Press the game's menu buttons in Play like a player: up, down, left, right, confirm, back, pause or inventory (presses, in order, a short pause between them), or select a row by its widget id. Answers the screen and the focused row after; take a screenshot to see it (menus that move the world, like a title camera turning to each option, need a moment).
| Argument | Type | What it does |
|---|---|---|
pause | number | Seconds between presses (default 0.15). |
presses | list of up / down / left / right / confirm / back / pause / inventory | Buttons in order, e.g. ["down", "down", "confirm"]. |
select | string | A row's widget id to move the focus to (instead of presses). |
ui_preset core
Whole game menus for a genre in one step: title, pause, settings (audio, graphics, controls with key and controller rebinding), game over, win, HUD, inventory, dialogue, loading, and a shop where the genre has one, each in its own arrangement (centred column, left rail, bottom bar, corner list) with a theme pack, staggered entrances and genre HUD pieces (ammo/crosshair, hearts/coins, speed/lap/position, score/lives). list: the genres and HUD templates. apply: writes UI/game.ui.json (or the scene's) keeping the game's items, controls, packs and extra screens (keep false: replace everything). hud (moba, shooter, souls) instead drops a data-bound genre HUD into the existing layout's hud screen (MOBA: ability bar with cooldown sweeps, mana, level, minimap with team icons and fog, K/D/A scoreboard, kill feed, team health, health bars and damage numbers; shooter: ammo + reserve, health/armour, crosshair + hit markers, damage direction, objective, kill feed, rotating minimap; souls: health/stamina/focus, boss bar, lock-on); scripts just set values. Then customise: ui_theme edit (fonts, frame art, colours, sounds, transitions), add_ui_screen (screens and widgets: anchor, enter, delay, idle, sound, focusSound, data, nav, order, font, textColor, align, list, minimap, world, binds, when), ui_theme preview to look.
| Argument | Type | What it does |
|---|---|---|
action | list / apply | |
genre | fantasy_rpg / scifi_shooter / platformer / horror / racing / cozy / arcade / visual_novel … | |
hud | moba / shooter / souls / openworld | A genre HUD template for the hud screen only (other screens kept). |
keep | boolean | Keep the game's items, controls, own packs and extra screens (default true). |
scene | string | Optional scene name for an independent layout; omit for the project default. |
tagline | string | The line under the game's name on the title screen, in the game's own words ("" for none). Left out, the preset's sample line stays (cozy: "A SLOW LIFE BY THE SEA") and the reply lists it. |
title | string |
ui_theme
Game UI theme packs (fonts, nine-slice frame art, colours, sounds, transitions for the dialogue box, shop, HUD, toasts and menus; look effects: glass {blur, tint, opacity, radius, gradient, edge, edgeAlpha, shadow, buttons} frosted panels, backdrop {mode dim|blur|live, blur, gradient, gradientAlpha, direction, scene, camera orbit|dolly|pan_up|drift|still, cameraSpeed}, highlight {style bar|sweep|bracket|underline|pill|plate, color, speed, glow}, particles {kind embers|dust|snow|stars|petals|fog|streaks|none, amount, color, speed, size}, and per font role glow, glowRadius, fill (gradient), sheen, tracking, uppercase). edit changes a game playing now at once. from_reference: picture (a menu screenshot, concept art or Nano Banana target; project path or absolute) in, a pack out: its colours clustered into background, panel, words, accent and muted, the nearest built-in look's fonts and effects recoloured to match, saved as pack (default from_picture; look picks the built-in look to start from instead of the nearest, e.g. pixel for a painted pixel-style picture; frames a sheet of the menu's frame art on a flat background, magenta best, key magenta|green|auto, cut by the 2D importer into nine-slice pieces box, plate, plateFocus, slot, slotFocus in reading order, saved in Assets/UI/<pack>), worn by the game when use is true, live at once, with a preview picture; tune it after with edit. action list: the packs (built-in fantasy, pixel, gothic, scifi, modern, storybook, plus the game's) and the project's fonts in Assets/Fonts. set: pack for the game, or for one scene with scene. edit: merge patch (a pack: colours background/panel/foreground/muted/accent/danger/success/ink/nameInk/dim, fonts {title, body, name, numbers: {file, scale, weight, pixel, grid, outline, outlineWidth, shadow, shadowOffset, tracking, uppercase}}, frames {box, plate, plateFocus, slot, slotFocus, ...: {image, slice, border, margin}}, sounds, typeSpeed, transition slide|pop|fade|steps|none, cursor) into theme.packs[pack]. preview: draws screen (dialogue, shop, hud, pause...) with the pack and sample words and returns the picture.
| Argument | Type | What it does |
|---|---|---|
action | list / set / edit / preview / from_reference | |
frames | string | |
key | string | |
look | string | |
pack | string | |
patch | object | |
picture | string | |
scene | string | |
screen | string | |
speaker | string | |
text | string | |
use | boolean |