UI / InputBox
InputBox Class
Input box
Hierarchy
↳
InputBox
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 whether to automatically wrap lines Returns
| Set auto wrap Parameters
|
contentColor
• | • | ||||
|---|---|---|---|---|---|
Set font content color Returns
| Get font content color Parameters
|
errorText
• | • | ||||
|---|---|---|---|---|---|
Get setting error prompt Returns
| Set error prompt Parameters
|
fontColor
• | • | ||||
|---|---|---|---|---|---|
Get the color of the current font Returns
| Set text color Parameters
|
fontLetterSpace
• | • | ||||
|---|---|---|---|---|---|
Obtain body spacing Returns
| Set font spacing Parameters
|
fontSize
• | • | ||||
|---|---|---|---|---|---|
Get font size Returns
| Set font size Parameters
|
glyph
• | • | ||||
|---|---|---|---|---|---|
Get font and glyph shapes Returns
| Set font and glyph shape Parameters
|
hintString
• | • | ||||
|---|---|---|---|---|---|
Get prompt text content Returns
| Set prompt content Parameters
|
inputTextLimit
• | • | ||||
|---|---|---|---|---|---|
Get the input format of the Input Box Returns
| Display the input format of the Input Box Parameters
|
isRichText
• | • | ||||
|---|---|---|---|---|---|
Get whether it is rich text Returns
| Set whether it is rich text Parameters
|
newLineKeyBind
• | • | ||||
|---|---|---|---|---|---|
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
| 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
|
onTextChanged
• | ||
|---|---|---|
Text Change Event Returns
|
onTextCommitted
• | ||
|---|---|---|
Text Submission Event Returns
|
outlineColor
• | • | ||||
|---|---|---|---|---|---|
Set font outline color Returns
| Get font outline color Parameters
|
outlineSize
• | • | ||||
|---|---|---|---|---|---|
Get font outline width Returns
| Set font outline width Parameters
|
readOnlyEnable
• | • | ||||
|---|---|---|---|---|---|
Obtain readability Returns
| Set readability Parameters
|
shadowColor
• | • | ||||
|---|---|---|---|---|---|
Get font shadow color Returns
| Set shadow color Parameters
|
shadowOffset
• | • | ||||
|---|---|---|---|---|---|
Get font shadow offset Returns
| Set Shadow offset Parameters
|
strikethroughEnable
• | • | ||||
|---|---|---|---|---|---|
Get whether to enable font strikethrough Returns
| Set whether to enable font strikethrough Parameters
|
text
• | • | ||||
|---|---|---|---|---|---|
Retrieve text content Returns
| Set text content Parameters
|
textAlign
• | • | ||||
|---|---|---|---|---|---|
Get font align Returns
| Set font align Parameters
|
textHeight
• | ||
|---|---|---|
Get the height of the text (the overall height of the text content, regardless of component size, affected by font properties) Returns
|
textLengthLimit
• | • | ||||
|---|---|---|---|---|---|
Get the word limit of the Input Box. The word limit is not applicable to the mailbox format and password format Returns
| Set the word limit of the current Input Box Parameters
|
textSingleHeight
• | ||
|---|---|---|
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
|
textVerticalAlign
• | • | ||||
|---|---|---|---|---|---|
Get the vertical alignment of the font Returns
| Set font vertical alignment method Parameters
|
underlineEnable
• | • | ||||
|---|---|---|---|---|---|
Get whether to enable font underline Returns
| Set whether to enable font underline Parameters
|
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 string | Hex 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 number | Usage: image R value< Range: [0, 255] type: integer |
|---|---|
G number | Usage: G value of image< Range: [0, 255] type: integer |
B number | Usage: image B value< Range: [0, 255] type: integer |
A number | Usage: 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 string | Usage: Hex color string range: string type conforming to Hex characteristics |
|---|
setFontColorDecimal
• setFontColorDecimal(R, G, B, A): void other
Set text color
Parameters
R number | Usage: text R value< Range: [0, 255] type: integer |
|---|---|
G number | Usage: Text G value< Range: [0, 255] type: integer |
B number | Usage: text B value< Range: [0, 255] type: integer |
A number | Usage: 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 string | Hex 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 number | Usage: Shadow R value< Range: [0, 255] type: integer |
|---|---|
G number | Usage: Shadow G value< Range: [0, 255] type: integer |
B number | Usage: Shadow B value< Range: [0, 255] type: integer |
A number | Usage: Shadow transparency< Range: [0, 255] type: integer |
setTextJustification
• setTextJustification(inTextJustification): void other
Set the align of the Input Box
Parameters
inTextJustification TextJustify | Usage: Alignment method |
|---|
newObject
• Static newObject(parent?, inName?): InputBox other
Create InputBox widget
Parameters
parent? Canvas | Usage: Create the external parent object of the control with default: null |
|---|---|
inName? string | Usage: name of the create widget default: null range: set a reasonable name |
Returns
InputBox | Return the created object |
|---|
When the parent and inName are the same as an existing object, the old object will be destroyed
Editor API