Skip to content
ClassInput & Controls@public

FlxInputText

Flixel text field backed by a native browser input for selection, IME, and mobile keyboard behavior. DOM changes become authoritative on fixed updates.

ts
export declare class FlxInputText extends FlxText

Constructors

ts
constructor(x?: number, y?: number, width?: number, text?: string, options?: FlxInputTextOptions)

Constructs a new instance of the FlxInputText class

ParameterTypeDescription
xnumber-
ynumber-
widthnumber-
textstring-
optionsFlxInputTextOptions-

Properties

PropertyModifiersTypeDescription
accessibleLabel-stringAccessible name announced for the native field.
backgroundColor-numberNative field background color.
composingreadonlybooleanWhether a native IME composition is active at the fixed boundary.
editable-booleanWhether text can change while the field remains focusable.
enabled-booleanWhether the native field accepts focus and editing.
focusedreadonlybooleanFocus state published at the fixed-update boundary.
focusedBorderColor-numberNative field border color while focused.
inputBorderColor-numberNative field border color while unfocused.
inputMode-stringVirtual-keyboard input mode hint.
maxLength-numberMaximum UTF-16 length; zero means unlimited.
multilinereadonlybooleanWhether this field uses multiline textarea behavior.
onSubmit-FlxInputTextSubmitCallback | nullCalled on a fixed update after Enter in a single-line field.
onTextChange-FlxInputTextChangeCallback | nullCalled once per fixed update that consumes a changed DOM value.
placeholder-stringNative input hint used when the value is empty.
selectionEndreadonlynumberFixed-step UTF-16 selection end.
selectionStartreadonlynumberFixed-step UTF-16 selection start.
tabIndex-numberNative keyboard tab order.
text-stringCurrent authoritative text value.
type-FlxInputTextTypeNative single-line field type. Ignored by multiline fields.

Methods

blur()

ts
blur(): void

Request native blur. The state becomes visible on the next fixed update.

Returns: void

destroy()

ts
destroy(): void

Release callbacks and render resources.

Returns: void

focus()

ts
focus(): void

Request native focus. The state becomes visible on the next fixed update.

Returns: void

select()

ts
select(start?: number, end?: number): void

Select a UTF-16 range and project it to the native field.

Parameters:

ParameterTypeDescription
startnumber-
endnumber-

Returns: void

update()

ts
update(): void

Consume queued native edits and callbacks, then advance normal text state.

Returns: void

Released under the MIT License.