Skip to reading
Actions, Properties & Runtime Updates

Change a border while the player types

Edition 0.86.4.4 Hotfix 2

Updated through 0.86.4.4 Hotfix 2, with cinematic property, recorded-pose or voice-timing lessons as described in this guide. Earlier examples, screenshots and complete registry figures retain their stated edition context.

Download PDFView illustrations

0.86.4.0 / Keep a draft during a style edit > p. 31

CHAPTER 10 / GUI DESIGNER

A small status button will turn the border of a code-entry box green. Using Hover lets us trigger the change while the text box still owns the keyboard.

In GUI Designer, select the button on the canvas. Its Events tab has Hover set to Change Gui Element Property.

1 Place two controls on the same GUI. In GUI Designer open Adventure HUD (hud), or use one of your own GUIs that is visible during play. Use Add Element to place a Text Box and a Button side by side. Give them IDs service_code and check_code. Set the button text to Check code.

2 Give the text box a visible border. Select the text box and set its border width to 4 and border color to gray. Leave any explicit hover border color unset for this demonstration so you can see the normal border change while the box is focused.

3 Add the behavior to the button. Select Check code, open Events and choose Hover. Set its behavior to Change Gui Element Property. Choose GUI hud, Element / Group service_code, Property borderColor and enter "#35c9a4" in To. Save the project.

The text box’s property and the exact color entered in To.

Which control does what?

The button owns the event, but the text box receives the color. Supplying both the GUI and the element ID also disambiguates two screens that reuse the same element ID.

Page 17 of 39Permalink
Go to page