Alert

Description

The Alert behavior will bring up an alert view and allow the user to enter text. It will trigger an event once the user presses OK, and will output the text the user has entered.

This behavior will trigger once on event.

 

Properties

Triggers Once on Event

Title

The title displayed on top of the alert pop up. By default the title is "Enter Text".

Message

A message for the player. This can be an instruction of some kind.

Default Text

This is the text that is already entered for the layer. You can leave it blank so that the keyboard input starts off with no characters. 

Pause Scene

You can choose to pause the scene while the player is typing. You will typically want to pause the scene unless the player is doing a time sensitive action like answer a test question or entering a pass code.

Alert Type

Select the type of alert to display on screen:

Simple (default): Shows a title, message and an OK button.

Multi-button: shows a title, message, and multiple additional buttons.

Multi-button w/ input: shows a title, message, an input box and multiple additional buttons.

Buttons

An array of button titles that will show when using alert type multi-button or multi-button w/ input.

Cancel Button Title

The title of the cancel button to show on the alert popup.

Secure Text Input

(Multi Button w/ input only) If this toggle is enabled, the text field is obscured and actual contents are hidden from view.

This would be used for sensitive fields such as passwords.

586E8A73-3A01-4EDB-9E73-AF078D0008E1.jpeg

This also prevents the input from being seen in screenshots and screen recordings.

Custom Colors

If toggled on, this will allow you to change the accent color and button colors for the alert UI.

77EF8769-68BE-4EF2-814C-06CC3C28603C.jpeg

Accent Color

The color of the cursor and the default text color used when a color is not defined for a button.

Cancel Button Color

The text color of the cancel button.

Button Colors

The HEX color of each text.

Each index corresponds to a button.

9763359F-DB76-4214-AD69-B7BD6042F0CA.jpeg

Outputs

User Text

This is the text that was entered by the user after they pressed OK. Multi-button w/ input alert mode only.

Button Index

When the user has pressed the cancel button, this will be -1. Pressing any other button will give a number that is 0 or higher depending on which button is pressed.

 

Examples

You can ask the player for their name and use it through out the game. 

 

TextInputReference.gif

0 Comments

Article is closed for comments.