Skip to content
InputBox

UI / InputBox

InputBox Class

Input box

Hierarchy

Table of contents

Properties

click

Properties

onCustomPropertyChange: Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Monitor custom attribute synchronization events

Accessors

autoWrap(): boolean other
Get whether to automatically wrap lines
contentColor(): LinearColor other
Set font content color
errorText(): string other
Get setting error prompt
fontColor(): LinearColor other
Get the color of the current font
fontLetterSpace(): number other
Obtain body spacing
fontSize(): number other
Get font size
glyph(): UIFontGlyph other
Get font and glyph shapes
hintString(): string other
Get prompt text content
inputTextLimit(): InputTextLimit other
Get the input format of the Input Box
isRichText(): boolean other
Get whether it is rich text
newLineKeyBind(): InsertNewLineType other
For the carriage return interaction of inserting a newline, please note that as long as the newline is triggered, the submission of text cannot be triggered. Enumeration may be set together through the Union of "
onTextChanged(): MulticastDelegate<(Text: string) => void> other
Text Change Event
onTextCommitted(): MulticastDelegate<(Text: string, CommitMethod: TextCommit) => void> other
Text Submission Event
outlineColor(): LinearColor other
Set font outline color
outlineSize(): number other
Get font outline width
readOnlyEnable(): boolean other
Obtain readability
shadowColor(): LinearColor other
Get font shadow color
shadowOffset(): Vector2 other
Get font shadow offset
strikethroughEnable(): boolean other
Get whether to enable font strikethrough
text(): string <Badge type="tip" text="other" />
Retrieve text content
textAlign(): TextJustify other
Get font align
textHeight(): number other
Get the height of the text (the overall height of the text content, regardless of component size, affected by font properties)
textLengthLimit(): number other
Get the word limit of the Input Box. The word limit is not applicable to the mailbox format and password format
textSingleHeight(): number other
Get the height of a single text line (the height of a single text line is independent of the size of the component and is affected by the font property)
textVerticalAlign(): TextVerticalJustify other
Get the vertical alignment of the font
underlineEnable(): boolean other
Get whether to enable font underline
click

Accessors

alignPosition(): Readonly<Vector2> other
Get the align position of the widget. When the align method is right align, bottom align, and center align, the value of alignPosition is different from that of position;
autoSizeHorizontalEnable(): boolean other
Get whether to automatically set the size horizontally
autoSizeVerticalEnable(): boolean other
Get whether to set the size automatically vertical
cachedGeometry(): Geometry other
Get the previous Get TickSpaceGeometry
constraints(): Readonly<UIConstraintAnchors> other
Get the layout of the control
desiredSize(): Vector2 other
Obtain expected size
enable(): boolean other
Is it available
guid(): string other
Get the widget GUID
isHovered(): boolean other
Is it hovered
mouseCursor(): MouseCursor other
Get the cursor type on the widget
name(): string other
Get Name
paintSpaceGeometry(): Geometry other
Get the last geometric information used to render the Widget
parent(): Widget other
Get parent node
pivot(): Vector2 other
Get the position of the widget anchor. This property determine the relative position of the widget graph and the anchor; At (0,0), the anchor point is located in the upper left corner of the control; (0.5,0.5), the anchor is at the center of the widget
position(): Readonly<Vector2> other
Get the position of the control
renderOpacity(): number other
Obtain rendering transparency
renderScale(): Vector2 other
Get rendering scaling
renderShear(): Vector2 other
Obtain rendering misalignment deformation
renderTransformAngle(): number other
Obtain the rendering angle
renderTransformPivot(): Vector2 other
Get Render anchor
size(): Vector2 other
Get size
tickSpaceGeometry(): Geometry other
Retrieve the last geometric information used to drive Widget Tick
transform(): Readonly<UITransform> other
Obtain the size and position of the control
visibility(): SlateVisibility other
Get visibility
visible(): boolean other
Is it visible
zOrder(): number other
Get Zorder

Methods

deFocus(): void other
Set the out of focus state of the Input Box and cancel the input state
focus(): void other
Set the focus state of the Input Box to enter the input state
setContentColorByHex(inHexString: string): void other
Set the content color of the input box, specify the color of Hex, and set the text color # 05050505
setContentColorDecimal(R: number, G: number, B: number, A: number): void other
Set the content color of the input box
setFontColorByHex(inHexString: string): void other
Set text color, specify the color of Hex Text Set color # 05050505
setFontColorDecimal(R: number, G: number, B: number, A: number): void other
Set text color
setShadowColorByHex(inHexString: string): void other
Set the shadow color, specify the color of Hex text Set Color # 05050505
setShadowColorDecimal(R: number, G: number, B: number, A: number): void other
Set shadow color
setTextJustification(inTextJustification: TextJustify): void other
Set the align of the Input Box
newObject(parent?: Canvas, inName?: string): InputBox other
Create InputBox widget
click

Methods

addChild(child: Widget): void other
Add child nodes
clone(position: Vector2, Parent?: any): Widget other
Clone the UI widget and its child nodes to the specified parent widget position (default to its parent node)
destroyObject(): void other
Remove and destroy immediately. Cannot be used again
equal(that: Widget): boolean other
Determine if it is the same object
findChildByPath(inPath: string): Widget other
Find nodes by relative path
getChildAt(index: number): Widget other
What is the position node to obtain
getChildByName<T: extends Widget<T>>(name: string): T: extends Widget<T> other
Search for nodes by name
getChildrenCount(): number other
Obtain the number of child nodes
getCustomProperties(): string[] other
Get all customize property
getCustomProperty<T: extends CustomPropertyType>(propertyName: string): T: extends CustomPropertyType other
Get customize property
getCustomPropertyChangeDelegate(property): Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Event proxy triggered when a given object property is modified
invalidateLayoutAndVolatility(): void other
Immediately trigger re rendering and layout calculation
removeAllChildren(): void other
Clearing all child nodes will destroy the UI and render it unusable
removeChild(child: Widget): void other
Removing a node will destroy the UI and make it unusable
removeChildAt(index: number): void other
Removing the third node will destroy the UI and render it unusable
removeObject(): void other
Immediately remove and add to the root node for reuse
serialize(): string other
Serialize UI widget
setCustomProperty(propertyName: string, value: undefined CustomPropertyType): void other
Set custom attributes
deserialize(Data: string, Parent?: Widget): Widget other
Deserialize UI

Properties

Accessors


autoWrap

get autoWrap(): boolean other

set autoWrap(inAutoWrap): void other

Get whether to automatically wrap lines

Returns

booleanDoes it automatically wrap

Set auto wrap

Parameters

inAutoWrap booleanUsage: Does it automatically wrap

contentColor

get contentColor(): LinearColor other

set contentColor(inContentColor): void other

Set font content color

Returns

LinearColorFont content color, TypeLinearColor type, data range 0~1

Get font content color

Parameters

inContentColor LinearColorUsage: Color, TypeLinearColor type, data range 0~1

errorText

get errorText(): string other

set errorText(inText): void other

Get setting error prompt

Returns

stringError prompt

Set error prompt

Parameters

inText stringUsage: error prompt

fontColor

get fontColor(): LinearColor other

set fontColor(inColor): void other

Get the color of the current font

Returns

LinearColorFont color, TypeLinearColor type, data range 0~1

Set text color

Parameters

inColor LinearColorUsage: Color, TypeLinearColor type, data range 0~1

fontLetterSpace

get fontLetterSpace(): number other

set fontLetterSpace(inLetterSpace): void other

Obtain body spacing

Returns

numberFont spacing

Set font spacing

Parameters

inLetterSpace numberUsage: font spacing

fontSize

get fontSize(): number other

set fontSize(inSize): void other

Get font size

Returns

numberfont size

Set font size

Parameters

inSize numberUsage: font size

glyph

get glyph(): UIFontGlyph other

set glyph(inGlyph): void other

Get font and glyph shapes

Returns

UIFontGlyphFont Shape

Set font and glyph shape

Parameters

inGlyph UIFontGlyphUsage: font and glyph settings

hintString

get hintString(): string other

set hintString(inHintString): void other

Get prompt text content

Returns

stringPrompt text content

Set prompt content

Parameters

inHintString stringUsage: prompt content

inputTextLimit

get inputTextLimit(): InputTextLimit other

set inputTextLimit(inLimit): void other

Get the input format of the Input Box

Returns

InputTextLimitInputTextLimit { Unlimited, limited to integers, limited to decimals, limited to numbers and letter, limited to passwords}

Display the input format of the Input Box

Parameters

inLimit InputTextLimitUsage: Unrestricted, limited to integers, limited to decimals, limited to numbers and letters, limited to passwords

isRichText

get isRichText(): boolean other

set isRichText(isRichText): void other

Get whether it is rich text

Returns

booleanIs it rich text

Set whether it is rich text

Parameters

isRichTextboolean

newLineKeyBind

get newLineKeyBind(): InsertNewLineType other

set newLineKeyBind(value): void other

For the carriage return interaction of inserting a newline, please note that as long as the newline is triggered, the submission of text cannot be triggered. Enumeration may be set together through the Union of "|". "&" is required to determine whether support is supported or not

Returns

InsertNewLineType

For the carriage return interaction of inserting a newline, please note that as long as the newline is triggered, the submission of text cannot be triggered. Enumerations can be set together through the Union of "|".

Parameters

valueInsertNewLineType

onTextChanged

get onTextChanged(): MulticastDelegate<(Text: string) => void> other

Text Change Event

Returns

MulticastDelegate<(Text: string) => void>Text Change Event

onTextCommitted

get onTextCommitted(): MulticastDelegate<(Text: string, CommitMethod: TextCommit) => void> other

Text Submission Event

Returns

MulticastDelegate<(Text: string, CommitMethod: TextCommit) => void>Text Submission Event

outlineColor

get outlineColor(): LinearColor other

set outlineColor(inOutlineColor): void other

Set font outline color

Returns

LinearColorFont stroke color, TypeLinearColor type, data range 0~1

Get font outline color

Parameters

inOutlineColor LinearColorUsage: Stroke color, TypeLinearColor type, data range 0~1

outlineSize

get outlineSize(): number other

set outlineSize(inOutlineSize): void other

Get font outline width

Returns

numberFont stroke width

Set font outline width

Parameters

inOutlineSize numberUsage: Width

readOnlyEnable

get readOnlyEnable(): boolean other

set readOnlyEnable(inValue): void other

Obtain readability

Returns

booleanWhether it is readable

Set readability

Parameters

inValue booleanUsage: readability

shadowColor

get shadowColor(): LinearColor other

set shadowColor(inShadowColor): void other

Get font shadow color

Returns

LinearColorFont shadow color, TypeLinearColor type, data range 0~1

Set shadow color

Parameters

inShadowColor LinearColorUsage: Color, TypeLinearColor type, data range 0~1

shadowOffset

get shadowOffset(): Vector2 other

set shadowOffset(inOffset): void other

Get font shadow offset

Returns

Vector2Font Shadow offset

Set Shadow offset

Parameters

inOffset Vector2Usage: offset

strikethroughEnable

get strikethroughEnable(): boolean other

set strikethroughEnable(inEnableStrikethrough): void other

Get whether to enable font strikethrough

Returns

booleanDo you want to enable font strikethrough

Set whether to enable font strikethrough

Parameters

inEnableStrikethrough booleanUsage: strikethrough

text

get text(): string other

set text(inText): void other

Retrieve text content

Returns

stringText Content

Set text content

Parameters

inText stringUsage: text

textAlign

get textAlign(): TextJustify other

set textAlign(inTextJustify): void other

Get font align

Returns

TextJustifyFont align

Set font align

Parameters

inTextJustify TextJustifyUsage: Alignment method

textHeight

get textHeight(): number other

Get the height of the text (the overall height of the text content, regardless of component size, affected by font properties)

Returns

numberText height

textLengthLimit

get textLengthLimit(): number other

set textLengthLimit(inTextLength): void other

Get the word limit of the Input Box. The word limit is not applicable to the mailbox format and password format

Returns

numberGet the word limit of the Input Box

Set the word limit of the current Input Box

Parameters

inTextLength numberUsage: Word limit

textSingleHeight

get textSingleHeight(): number other

Get the height of a single text line (the height of a single text line is independent of the size of the component and is affected by the font property)

Returns

numberText single line height

textVerticalAlign

get textVerticalAlign(): TextVerticalJustify other

set textVerticalAlign(inTextVerticalJustify): void other

Get the vertical alignment of the font

Returns

TextVerticalJustifyFont vertical align

Set font vertical alignment method

Parameters

inTextVerticalJustify TextVerticalJustifyUsage: Alignment method

underlineEnable

get underlineEnable(): boolean other

set underlineEnable(inEnableUnderline): void other

Get whether to enable font underline

Returns

booleanTrue: on, false: off

Set whether to enable font underline

Parameters

inEnableUnderline booleanUsage: Offline

Methods


deFocus

deFocus(): void other

Set the out of focus state of the Input Box and cancel the input state


focus

focus(): void other

Set the focus state of the Input Box to enter the input state


setContentColorByHex

setContentColorByHex(inHexString): void other

Set the content color of the input box, specify the color of Hex, and set the text color # 05050505

Parameters

inHexString stringHex Color string range: a string type that conforms to the characteristics of Hex

setContentColorDecimal

setContentColorDecimal(R, G, B, A): void other

Set the content color of the input box

Parameters

R numberUsage: image R value< Range: [0, 255] type: integer
G numberUsage: G value of image< Range: [0, 255] type: integer
B numberUsage: image B value< Range: [0, 255] type: integer
A numberUsage: image transparency< Range: [0, 255] type: integer

setFontColorByHex

setFontColorByHex(inHexString): void other

Set text color, specify the color of Hex Text Set color # 05050505

Parameters

inHexString stringUsage: Hex color string range: string type conforming to Hex characteristics

setFontColorDecimal

setFontColorDecimal(R, G, B, A): void other

Set text color

Parameters

R numberUsage: text R value< Range: [0, 255] type: integer
G numberUsage: Text G value< Range: [0, 255] type: integer
B numberUsage: text B value< Range: [0, 255] type: integer
A numberUsage: text transparency< Range: [0, 255] type: integer

setShadowColorByHex

setShadowColorByHex(inHexString): void other

Set the shadow color, specify the color of Hex text Set Color # 05050505

Parameters

inHexString stringHex Color string range: a string type that conforms to the characteristics of Hex

setShadowColorDecimal

setShadowColorDecimal(R, G, B, A): void other

Set shadow color

Parameters

R numberUsage: Shadow R value< Range: [0, 255] type: integer
G numberUsage: Shadow G value< Range: [0, 255] type: integer
B numberUsage: Shadow B value< Range: [0, 255] type: integer
A numberUsage: Shadow transparency< Range: [0, 255] type: integer

setTextJustification

setTextJustification(inTextJustification): void other

Set the align of the Input Box

Parameters

inTextJustification TextJustifyUsage: Alignment method

newObject

Static newObject(parent?, inName?): InputBox other

Create InputBox widget

Parameters

parent? CanvasUsage: Create the external parent object of the control with default: null
inName? stringUsage: name of the create widget default: null range: set a reasonable name

Returns

InputBoxReturn the created object

When the parent and inName are the same as an existing object, the old object will be destroyed