Class: UIText
WebSG.UIText
Class representing a text element within a user interface.
Hierarchy
Table of contents
Constructors
Properties
Accessors
- alignContent
- alignItems
- alignSelf
- bottom
- flexBasis
- flexDirection
- flexGrow
- flexShrink
- flexWrap
- fontFamily
- fontSize
- fontStyle
- fontWeight
- height
- justifyContent
- left
- maxHeight
- maxWidth
- minHeight
- minWidth
- parent
- position
- right
- top
- type
- value
- width
Methods
Constructors
constructor
• new UIText()
Inherited from
Properties
backgroundColor
• Readonly
backgroundColor: RGBA
Readonly RGBA object representing the background color of the UI element.
Inherited from
Defined in
borderColor
• Readonly
borderColor: RGBA
Readonly RGBA object representing the border color of the UI element.
Inherited from
Defined in
borderRadius
• Readonly
borderRadius: Vector4
Readonly Vector4 object representing the border radius of the UI element.
Inherited from
Defined in
borderWidth
• Readonly
borderWidth: Vector4
Readonly Vector4 object representing the border width of the UI element.
Inherited from
Defined in
color
• Readonly
color: RGBA
Readonly property representing the color of the text as an RGBA object.
Defined in
margin
• Readonly
margin: Vector4
Readonly Vector4 object representing the margin of the UI element.
Inherited from
Defined in
padding
• Readonly
padding: Vector4
Readonly Vector4 object representing the padding of the UI element.
Inherited from
Defined in
Accessors
alignContent
• get
alignContent(): FlexAlign
Gets the align-content property of the UI element.
Returns
Inherited from
UIElement.alignContent
Defined in
• set
alignContent(value
): void
Sets the align-content property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | FlexAlign | The new align-content value for the UI element. |
Returns
void
Inherited from
UIElement.alignContent
Defined in
alignItems
• get
alignItems(): FlexAlign
Gets the align-items property of the UI element.
Returns
Inherited from
UIElement.alignItems
Defined in
• set
alignItems(value
): void
Sets the align-items property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | FlexAlign | The new align-items value for the UI element. |
Returns
void
Inherited from
UIElement.alignItems
Defined in
alignSelf
• get
alignSelf(): FlexAlign
Gets the align-self property of the UI element.
Returns
Inherited from
UIElement.alignSelf
Defined in
• set
alignSelf(value
): void
Sets the align-self property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | FlexAlign | The new align-self value for the UI element. |
Returns
void
Inherited from
UIElement.alignSelf
Defined in
bottom
• get
bottom(): number
Gets the bottom position of the UI element in pixels.
Returns
number
Inherited from
UIElement.bottom
Defined in
• set
bottom(value
): void
Sets the bottom position of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new bottom position value for the UI element in pixels. |
Returns
void
Inherited from
UIElement.bottom
Defined in
flexBasis
• get
flexBasis(): number
Gets the flex basis property of the UI element in pixels.
Returns
number
Inherited from
UIElement.flexBasis
Defined in
• set
flexBasis(value
): void
Sets the flex basis property of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new flex basis property value in pixels. |
Returns
void
Inherited from
UIElement.flexBasis
Defined in
flexDirection
• get
flexDirection(): FlexDirection
Gets the flex-direction property of the UI element.
Returns
Inherited from
UIElement.flexDirection
Defined in
• set
flexDirection(value
): void
Sets the flex-direction property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | FlexDirection | The new flex-direction value for the UI element. |
Returns
void
Inherited from
UIElement.flexDirection
Defined in
flexGrow
• get
flexGrow(): number
Gets the flex grow property of the UI element.
Returns
number
Inherited from
UIElement.flexGrow
Defined in
• set
flexGrow(value
): void
Sets the flex grow property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new flex grow property value. |
Returns
void
Inherited from
UIElement.flexGrow
Defined in
flexShrink
• get
flexShrink(): number
Gets the flex shrink property of the UI element.
Returns
number
Inherited from
UIElement.flexShrink
Defined in
• set
flexShrink(value
): void
Sets the flex shrink property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new flex shrink property value. |
Returns
void
Inherited from
UIElement.flexShrink
Defined in
flexWrap
• get
flexWrap(): FlexWrap
Gets the flex wrap property of the UI element.
Returns
Inherited from
UIElement.flexWrap
Defined in
• set
flexWrap(value
): void
Sets the flex wrap property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | FlexWrap | The new flex wrap property value. |
Returns
void
Inherited from
UIElement.flexWrap
Defined in
fontFamily
• get
fontFamily(): string
Gets the font family used for the text.
Returns
string
Defined in
• set
fontFamily(value
): void
Sets the font family used for the text.
Parameters
Name | Type | Description |
---|---|---|
value | string | The new font family. Accepts any valid CSS font-family value. |
Returns
void
Defined in
fontSize
• get
fontSize(): number
Gets the font size of the text in pixels.
Returns
number
Defined in
• set
fontSize(value
): void
Sets the font size of the text in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new font size. Accepts any valid CSS font-size value. |
Returns
void
Defined in
fontStyle
• get
fontStyle(): string
Gets the font style used for the text.
Returns
string
Defined in
• set
fontStyle(value
): void
Sets the font style used for the text.
Parameters
Name | Type | Description |
---|---|---|
value | string | The new font style. Accepts any valid CSS font-style value. |
Returns
void
Defined in
fontWeight
• get
fontWeight(): string
Gets the font weight used for the text.
Returns
string
Defined in
• set
fontWeight(value
): void
Sets the font weight used for the text.
Parameters
Name | Type | Description |
---|---|---|
value | string | The new font weight. Accepts any valid CSS font-weight value. |
Returns
void
Defined in
height
• get
height(): number
Gets the height of the UI element in pixels.
Returns
number
Inherited from
UIElement.height
Defined in
• set
height(value
): void
Sets the height of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new height of the UI element in pixels. |
Returns
void
Inherited from
UIElement.height
Defined in
justifyContent
• get
justifyContent(): FlexJustify
Gets the justify content property of the UI element.
Returns
Inherited from
UIElement.justifyContent
Defined in
• set
justifyContent(value
): void
Sets the justify content property of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | FlexJustify | The new justify content property value. |
Returns
void
Inherited from
UIElement.justifyContent
Defined in
left
• get
left(): number
Gets the left position of the UI element in pixels.
Returns
number
Inherited from
UIElement.left
Defined in
• set
left(value
): void
Sets the left position of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new left position value for the UI element in pixels. |
Returns
void
Inherited from
UIElement.left
Defined in
maxHeight
• get
maxHeight(): number
Gets the maximum height of the UI element in pixels.
Returns
number
Inherited from
UIElement.maxHeight
Defined in
• set
maxHeight(value
): void
Sets the maximum height of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new maximum height of the UI element. |
Returns
void
Inherited from
UIElement.maxHeight
Defined in
maxWidth
• get
maxWidth(): number
Gets the maximum width of the UI element.
Returns
number
Inherited from
UIElement.maxWidth
Defined in
• set
maxWidth(value
): void
Sets the maximum width of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new maximum width of the UI element in pixels. |
Returns
void
Inherited from
UIElement.maxWidth
Defined in
minHeight
• get
minHeight(): number
Gets the minimum height of the UI element in pixels.
Returns
number
Inherited from
UIElement.minHeight
Defined in
• set
minHeight(value
): void
Sets the minimum height of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new minimum height of the UI element. |
Returns
void
Inherited from
UIElement.minHeight
Defined in
minWidth
• get
minWidth(): number
Gets the minimum width of the UI element in pixels.
Returns
number
Inherited from
UIElement.minWidth
Defined in
• set
minWidth(value
): void
Sets the minimum width of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new minimum width of the UI element in pixels. |
Returns
void
Inherited from
UIElement.minWidth
Defined in
parent
• get
parent(): undefined
| UIElement
Gets the parent UI element of the current element or undefined if the element has no parent.
Returns
undefined
| UIElement
Inherited from
UIElement.parent
Defined in
position
• get
position(): ElementPositionType
Gets the position of the UI element.
Returns
Inherited from
UIElement.position
Defined in
• set
position(value
): void
Sets the position of the UI element.
Parameters
Name | Type | Description |
---|---|---|
value | ElementPositionType | The new position type for the UI element. |
Returns
void
Inherited from
UIElement.position
Defined in
right
• get
right(): number
Gets the right position of the UI element in pixels.
Returns
number
Inherited from
UIElement.right
Defined in
• set
right(value
): void
Sets the right position of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new right position value for the UI element in pixels. |
Returns
void
Inherited from
UIElement.right
Defined in
top
• get
top(): number
Gets the top position of the UI element in pixels.
Returns
number
Inherited from
UIElement.top
Defined in
• set
top(value
): void
Sets the top position of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new top position value for the UI element in pixels. |
Returns
void
Inherited from
UIElement.top
Defined in
type
• get
type(): ElementType
Gets the type of the UI element.
Returns
Inherited from
UIElement.type
Defined in
value
• get
value(): string
Gets the text content of the UIText element.
Returns
string
Defined in
• set
value(value
): void
Sets the text content of the UIText element.
Parameters
Name | Type | Description |
---|---|---|
value | string | The new text content. |
Returns
void
Defined in
width
• get
width(): number
Gets the width of the UI element in pixels.
Returns
number
Inherited from
UIElement.width
Defined in
• set
width(value
): void
Sets the width of the UI element in pixels.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new width of the UI element in pixels. |
Returns
void
Inherited from
UIElement.width
Defined in
Methods
addChild
▸ addChild(element
): UIText
Adds a child UI element to the current element.
Parameters
Name | Type | Description |
---|---|---|
element | UIElement | The child UI element to add. |
Returns
Inherited from
Defined in
children
▸ children(): UIElementIterator
Returns an iterator for the children of the current UI element.
Returns
Inherited from
Defined in
getChild
▸ getChild(index
): undefined
| UIElement
Gets the child UI element at the specified index or undefined if the index is out of bounds.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the child UI element. |
Returns
undefined
| UIElement
Inherited from
Defined in
removeChild
▸ removeChild(element
): UIText
Removes a child UI element from the current element.
Parameters
Name | Type | Description |
---|---|---|
element | UIElement | The child UI element to remove. |