scene_add_text_box
Adds a text box to a copied save so you can display static words, numbers, or live custom-variable values on screen in Miliastra scenes.
Instructions
Put a text box (文本框) on the screen, in a copy of a save: words, numbers that follow custom variables, or both. A variable is written into the text as {1:ps.name} for a custom variable of the player who sees it, {1:lv.name} for one of the stage entity, {1:p1.name} to {1:p8.name} for one of that player: "金币:{1:ps.coins}" shows the number as a graph changes it. position is [x, y] from the screen centre on a 1600 x 900 canvas (y up), size [width, height], fontSize the size of the letters. IMPORTANT: custom text is shown only on accounts whose 奇匠 level is 2 or higher (seen in play on level 2, 2026-10-13: the number follows the variable); on a level 1 account the box is there and shows nothing (measured with the official sample itself). Before a game relies on text, put one box in and look at a playtest screenshot; if nothing shows, say what has to be said without words (scene_add_progress_bar, markers, effects: read_knowledge {id: "feedback.zh-CN"}). The three records are byte for byte those of the official sample 界面控件.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| size | No | ||
| text | Yes | ||
| mapPath | No | ||
| fontSize | No | ||
| position | No | ||
| outputName | No |