Construct 3 icon

Construct 3

Documentation

Text Input script interface

Ashley's avatar
Medal
Construct Team Founder
Published 12 Aug, 2019
183 words
<1 min

The ITextInputInstance interface derives from IDOMInstance to add APIs specific to the Text Input plugin.

Text Input events

"click"

"dblclick"

Fired when the control is clicked or double-clicked.

"change"

Fired when user input causes the text property to change.

Button APIs

text

The current string entered in the input field.

placeholder

A string of text that appears faintly when the field is empty. This can be used for hints for what the field is for, e.g. Username.

tooltip

A tooltip that appears if the user hovers the mouse over the text box and waits. An empty string indicates no tooltip.

isEnabled

A boolean indicating if the control is enabled or disabled.

isReadOnly

A boolean indicating if the input field is read-only, which means the text cannot be modified but can still be selected. This is different to disabling the field, where text cannot be selected.

scrollToBottom()

Scroll to the bottom of the control. Only has an effect when set to the textarea type, since it is the only multiline mode. This is useful for chat or log style textareas.