Skip to content

Add Button ​

Category: Message

Event content that adds a single button at an arbitrary position on the screen. Whereas Add Choice is for menus inside a selection window, this event content creates buttons placed freely on the screen.

Difference from Add Choice

ItemAdd ChoiceAdd Button (this event content)
PurposeMenu inside a selection windowButton placed freely on the screen
PlacementLined up vertically in the selection windowAny position / any size
Behavior on addInternal data only, not shown on screenButton is generated immediately (but hidden)
DisplayShown all at once via Show Selection WindowShown all at once via Show Buttons
Focus movementnext/previous in insertion orderPosition-based (auto-calculated from layout)

Use in pair with Show Buttons

When this event content runs, the button is generated but remains hidden (visible=false). To actually display it on screen, after lining up as many Add Buttons as needed, run Show Buttons.

Typical usage:

  1. Add Button (number 0, text Yes)
  2. Add Button (number 1, text No)
  3. Show Buttons <- the buttons appear on screen only here

Property List ​

Item (tscn label)Input typeDescription
ButtonSelectionButton design ID (selected from button_data in the UI tab)
NumberNumber (0-100)Button number (for identification, can overwrite with the same number)
TextTextText displayed on the button (special notation supported)
Size x / yNumber (px)Button size
Position x / yNumber (px)Display position of the button (coordinates with the top-left of the screen as 0,0)
Screen Center buttons x 2-Automatically set Position x / y to screen center
EventSelectionEvent to transition to on click (empty allowed)
LabelTextLabel name within the destination event (if empty, starts from the beginning)
Preview button-Preview the button on screen with the current settings
Text Help button-Open the special notation reference

Property Details ​

Button ​

Select the button design from button_data defined in the UI tab.

  • Options: automatically enumerated from all button designs created in the UI tab
  • The button appearance (theme, font, color) follows the design specified here
  • Cannot be empty (some button_data must always be specified)

Preset auto-apply (added 2026-09-17)

When you select a button, the presets (size, position) set on that button design are automatically reflected in this event content's size and position fields. Useful as initial values before manual adjustment.

Number ​

A number for identifying the button (integer 0-100, step 1).

  • Specifying the same number overwrites: If you Add Button with the same number as an existing button, the existing button is replaced
  • Also affects draw order (Z-order): The larger the number, the more frontmost it is displayed (same mechanism as Show Window)
  • When placing multiple buttons, if they do not overlap, 0, 1, 2, ... is fine. If they overlap, give the button you want in front a larger number

Text ​

The text displayed on the button.

  • Special notation supported: Variable expansion ({var}), name expansion ({@char.MEM_0}), line break ([LF]), color change, and other special notations are available
  • Translation target: When localizing in the Translation tab, it is automatically extracted as a translation key
  • Added 2026-10-01: Formula reference expansion and smart_number formatting also apply (unified with Show Text)

Examples: Yes, No, Attack, Gold {gold} G

Size x / y (Size x, Size y) ​

Specify the width and height of the button in pixels.

  • Input fields are lined up horizontally with two slots: left is x (width), right is y (height)
  • Unit is pixel (px)
  • Empty or invalid values are treated as 0

Example: 200 x 60 -> a button 200px wide x 60px tall

Position x / y (Position x, Position y) ​

Specify the screen coordinates where the button is placed, in pixels.

  • Origin: The top-left of the screen is (0, 0), x is rightward, y is downward
  • Input fields are split into two rows, each with "number input + screen center button"
  • "Screen Center" button: When pressed, auto-calculates the position so the button is at screen center and fills the input field
    • x-side calculation: (screen width - size x) / 2
    • y-side calculation: (screen height - size y) / 2
    • If you change the size later, you need to press it again

Example: With size 200 x 60 and position x=540, y=330 -> roughly centered on a 1280x720 screen

Event ​

Specify the event to transition to when the button is clicked.

  • Options: automatically enumerated from all .json filenames in data/settings/events/
  • Empty allowed: if no event is specified, continues within the current event (proceeds to the next event content)

Event transition behavior

When Event is specified, after a click, processing equivalent to "Move To Event" is performed. The destination event starts a new flow.

When Event is empty, after a click, processing continues within the current event (typically combined with Conditional Branch to write different processing for each button result).

Label ​

Specify the label name within the destination event.

  • Empty: executes from the beginning of the destination event
  • Value specified: starts execution from Set Label (<label name>) within the destination event

Label is meaningless when Event is empty

When Event is empty, no transition occurs even if Label is specified, so the Label specification is meaningless.

Preview button ​

Pressing the button previews the button on screen with the current settings. You can visually confirm placement and size.

Text Help button ​

Pressing the button opens the special notation reference window. For details, see Text Special Notation Reference.

Runtime Behavior ​

When this event content runs, processing happens in the following order:

1. Formula reference expansion (added 2026-10-01) ​

Formula references within the text (such as USER.STR.MAX) are expanded to actual values. Furthermore, via smart_number processing, numbers with 0 after the decimal point (100.0) are displayed as integers like "100". This is the same processing as Show Text / Add Choice.

2. Button data save and immediate generation ​

  1. Internal button data (button_data) gets 1 entry added or updated
    • button (design ID), number, text (post-expansion text), size x/y, position x/y, event, label
  2. Button node is generated immediately (inherits the design of the specified UI tab)
  3. Waits with visible=false (hidden)
  4. Z-order (z_index) = number is set (larger number is more frontmost)
  5. Automatically proceeds to the next event content (no wait)

When subsequent Show Buttons runs, all buttons added up to that point become visible=true and are displayed on screen.

3. Automatic focus movement setup (at Show Buttons time) ​

When Show Buttons runs, the following is set automatically:

  • Position-based focus movement: From the coordinates of the placed buttons, the nearest buttons in up/down/left/right directions are automatically selected and set as keyboard/gamepad focus movement (up/down/left/right)
  • Whereas Add Choice is insertion order next/previous, this event content is position-based up/down/left/right

Focus movement depends on layout

Focus movement in this event content is auto-calculated from on-screen placement, so keyboard/gamepad navigation behavior changes based on where you place the buttons. Diagonal placement or extremely distant placement may result in unintended focus movement.

Placement aligned on the same row or same column is recommended.

4. Behavior on click ​

When a button is clicked, the following processing occurs:

  • The decision sound (system's sound_decide) is played
  • Both event / label empty: continues within the current event (proceeds to the next event content)
  • Either event or label present: transitions to the specified event / label
  • In either case, all internal button data is cleared, so to redisplay buttons, you need to line up Add Buttons again from scratch

Typical Usage Flows ​

Flow 1: 2-choice buttons at screen center ​

  1. Show Text (number 0) <- "Do you really want to fight?"
  2. Add Button (number 0, text Yes, size 200x60, position 400, 350, event battle_scene)
  3. Add Button (number 1, text No, size 200x60, position 680, 350, event empty)
  4. Show Buttons <- the buttons appear on screen only here
  5. (When "No" is selected, comes here) Show Text <- "Escaped"

Flow 2: 4 buttons at the four screen corners ​

  1. Add Button (number 0, text Top-left, position 100, 100)
  2. Add Button (number 1, text Top-right, position 1000, 100)
  3. Add Button (number 2, text Bottom-left, position 100, 600)
  4. Add Button (number 3, text Bottom-right, position 1000, 600)
  5. Show Buttons

Since they are placed at the four corners, focus moves naturally with the keyboard up/down/left/right.

Flow 3: Center placement using the Screen Center button ​

  1. Add Button
    • Enter size x: 300, size y: 80
    • Press the "Screen Center" button for position x -> the calculated value is auto-entered
    • Press the "Screen Center" button for position y -> the calculated value is auto-entered
  2. Show Buttons

Flow 4: Overwrite with the same number ​

Change the button text according to game progress:

  1. Add Button (number 0, text Start)
  2. Show Buttons
  3. (After user operation)
  4. Add Button (number 0, text Continue) <- overwrite with the same number
  5. Show Buttons

Flow 5: Dynamic with variables and formula references ​

  1. Add Button (number 0, text Buy with {gold} G in hand, event buy)
  2. Add Button (number 1, text Challenge at Level MEM_0.LEVEL.NOW, event challenge)

Using variable expansion and formula references, you can display text that adapts to runtime conditions.

Typical Combinations ​

This event content is always used in pair with Show Buttons. By itself, no button appears on the screen. For the big picture, see Combination Pattern Collection.

Basic free-placement button group ​

Question -> Add Button x N -> Show Buttons -> Transition.

  1. Show Window (number 0)
  2. Show Text (number 0) <- "Which one will you choose?"
  3. Add Button (this event content) (number 0, text A, position 400, 350)
  4. Add Button (this event content) (number 1, text B, position 680, 350)
  5. Show Buttons <- the buttons appear on screen here
  6. (Transitions on button click)

Show a new button group after resetting existing buttons ​

Use different button sets within the same event:

  1. Add Button (this event content) x N
  2. Show Buttons
  3. (After operation)
  4. Reset Buttons <- delete buttons in bulk
  5. Add Button (this event content) x M <- new button group
  6. Show Buttons

Button set inside a window ​

Combining windows and buttons for a menu-screen look:

  1. Show Window (number 0, size 600x400, position 340, 160)
  2. Add Button (this event content) (number 1, text Equip, position 400, 250)
  3. Add Button (this event content) (number 1, text Items, position 600, 250)
  4. Add Button (this event content) (number 1, text Back, position 800, 250)
  5. Show Buttons

By making the button's number (1) larger than the window's number (0), the buttons are displayed in front of the window.

Related event contentPurpose
Show ButtonsDisplay the added buttons on screen (always used in pair)
Reset ButtonsDelete all added buttons in bulk
Add ChoiceAdd a choice for the selection window (contrasted with this event content)
Show WindowPlace a window as the background for buttons
Hide All WindowsErase only background windows in bulk (buttons must be erased separately with Reset Buttons)
Set LabelDefine a label within the destination event
Move To EventEvent transition without using buttons
PageRelated content
Text Special Notation ReferenceSpecial notations usable within text
UI tabReference for the Button property (button design definitions)
Event tabReference for the Event property
Variable tabFor {variable name} expansion within button text
Event Content ListList of all event contents

Notes ​

Add Button alone does not display on screen ​

When this event content runs, the button node is generated, but remains hidden (visible=false). Always run Show Buttons afterward.

Same number overwrites ​

Adding Add Button with the same number replaces the existing button. To avoid unintended overwrites, offset numbers when placing multiple buttons (0, 1, 2, ...).

Z-order follows number ​

The larger the number, the more frontmost it is displayed. For overlapping placement, adjust numbers to achieve the intended front/back relationship (same mechanism as Show Window).

Focus movement is position-based ​

The target of up/down/left/right focus movement on keyboard/gamepad is auto-selected from placement. The behavior differs from Add Choice's insertion-order next/previous. Diagonal or extremely distant placement may result in unintended focus movement, so aligned placement on the same row/column is recommended.

All internal data cleared after click ​

When a button is clicked, not only the clicked button but all button data is internally cleared. If you want to show the same button again after a click, you need to line up Add Buttons again.

Press Screen Center buttons after entering size ​

The "Screen Center" button calculates the position using the size x / y at the time of input. If you change the size afterward, press "Screen Center" again.

When Event is empty, handle with Conditional Branch ​

When Event is empty, after a click processing continues within the current event. In this case, you need to determine which button was pressed with a subsequent Conditional Branch.

Text special notation and translation ​

Button text can be localized in the Translation tab. For details, see Translation tab.