Text||doc135342

September 20, 2022

Text

Introduction

Text control is a UI control used to display text content. It is the most basic and important element for the GUI. The text content of the control can be dynamically modified when the game is running.

Attribute

string Text
Text content.
Color3 TextColor
Text color.
TextHorizontalFormat TextHorizontalFormat
Text horizontal layout format.
TextVerticalFormat TextVerticalFormat
Vertical text formatting.
bool WordWrapped
Text wrap.
bool WordBreak
Text wrapping allows words to be split.
AutoFrameSize AutoFrameSize
Automatic resizing mode for text controls.
bool AutoTextSize
Text is automatically scaled.
int MinAutoTextSize
Minimum font size for automatic text scaling.
FontStyle FontStyle
Font style.
int FontSize
Font size.
FontWeight FontWeight
The words are heavy and the font is thick and thin.
int TextBorderWidth
Border width.
Color3 TextBorderColor
Border color.
float TextWidth
Text content width.
float TextHeight
Text content height
bool BackgroundEnabled
Enables the text control background.
Color3 BackgroundColor
Text control background color.

inherited fromWindow

string Name
Name of the window
float Alpha
Window opacity
bool Visible
Show window
bool Disabled
Disable window
bool ClippedByParent
Whether to crop out the rendered part beyond the boundary of the parent control
bool TouchThrough
Whether touch can penetrate the window
AlignmentFormat AlignmentFormat
Determines the alignment of the rendered window
UDim2 Position
Determine the position of the window
UDim2 Size
Determine the size of the window
Vector3 Rotation
Determines the rotation angle of the window
Vector2 RelativelyPosition
Determine the relative position of the window
Vector2 AbsolutelyPosition
Determine the absolute position of the window
Vector2 RelativelySize
Determines the relative size of the window
Vector2 AbsolutelySize
Determines the absolute size of the window
Window Parent
Determine the parent of the window
int SiblingOrder
Determine the order in which windows are arranged

Function

inherited fromWindow

Vector2 GetPixelPosition ()
Returns the actual pixel position relative to the device screen
Vector2 GetPixelSize ()
Returns the actual pixel size compared to the device screen
bool IsValid ()
Determine if window reference is valid
int GetID ()
Returns the unique identification of the window
int GetChildCount ()
Returns the number of child windows
void AddChild ( Window child )
Add child window
void RemoveChild ( Window child )
Remove child window
Window GetChildByID ( int ID )
Return to child window based on unique ID
void RemoveChildByID ( int ID )
Remove child windows based on unique identification
Window GetChildByName ( string name )
Returns a child window by window name
table<Window> GetChildren ()
Returns an array of all child windows
bool IsChild ( Window window )
Determine whether the window is a child window
bool IsAncestor ( Window window )
Determine whether the window is the parent
Window Clone ()
Create a copy of a window and all its child windows
void Destroy ()
Destroy Window
void DestroyAllChildren ()
Destroy all child windows
Tween DoTween ( TweenInfo tweenInfo, table<string, variant> properties )
Create and start jog animation
BindableEvent GetEvent ( string eventName )
Get events for window controls

Event

inherited fromWindow

BindableEvent OnTouchDown
Event triggered when a touch is pressed in the target control
BindableEvent OnTouchUp
Event triggered when the target control is touched and lifted
BindableEvent OnTouchMove
An event is triggered when a finger moves in the process of being touched in the target control
BindableEvent OnClick
Event triggered when the target control is clicked
BindableEvent OnDestroy
Event triggered before the target control is destroyed
BindableEvent OnChildAdded
Event triggered after adding child controls to the target control
BindableEvent OnChildRemoved
Event triggered when a child control is removed from the target control
BindableEvent OnShown
Visible = true triggers an event when the target control is switched to visible
BindableEvent OnHidden
Visible = false triggers an event when the target control is switched to invisible