REDNODE / DOCS

Ink test

Example apps / ink-test / v0.1.1

Node modbridge permission

The spike of the ink API: reach the game's own UI, add widgets to it, hear clicks, time changes, open a game screen and read a screen's widget tree.

Simulated game starting
Mod log

    The preview has no game UI: the buttons log the calls they would make, and most of them fail with the simulated game's answer.

    How it works

    The game draws its own UI with ink, a tree of widgets. REDnode's script REDnodeInk.reds keeps the roots of a few HUD and menu controllers, and the app reaches them with api.$static("REDnodeInk", "Root", name). With Codeware, its layers work too (cw.inkHUDLayer).

    HUD text and Menu button add widgets with AddChild, then set their font, text, size, margin and tint one call at a time. The button registers REDnodeInkListener, a script class whose handlers send game events the app hears with game.on.

    Speed times one change, 50 in a row, and 200 and 600 at once. Open screen queues a StartHubMenuEvent. Menu entries finds the game's menu resources through REDbridge and reads them through Codeware. Read screen walks a root's tree level by level and writes it to a file in the app's data folder.

    What it uses

    api.$static api.$new inkCompoundWidget.AddChild RegisterToCallback StartHubMenuEvent kernel.bridge pkg.dataDir game.on

    Try this

    Use it

    Copy the files into red4ext/plugins/REDnode/apps/ink-test/ in the game folder, or start your own package from them: change id and name in the manifest first. The whole folder is on GitHub.