m ProbablePrime moved page Text (Component) to Component:Text: Creating component Namespace |
Automated: update Fields, Categories |
||
Line 16: | Line 16: | ||
== Usage == | == Usage == | ||
{{Table ComponentFields | {{Table ComponentFields | ||
|Font|FontSet|The font to use | |Font|{{RootFieldType|AssetRef`1|[[Type:FontSet|FontSet]]}}|TypeAdv0=true|The font to use | ||
|Content|String|What to display | |Content|String|What to display | ||
|ParseRichText|Bool|Whether or not to interpret [[Text Formatting|text formatting]] | |ParseRichText|Bool|Whether or not to interpret [[Text Formatting|text formatting]] | ||
Line 24: | Line 24: | ||
|VerticalAlign|TextVerticalAlignment|How to align the text, vertically | |VerticalAlign|TextVerticalAlignment|How to align the text, vertically | ||
|AlignmentMode|AlignmentMode|How to compute alignment | |AlignmentMode|AlignmentMode|How to compute alignment | ||
|Color| | |Color|ColorX|The color to render the text with | ||
|Materials|Material|The Material(s) to render with | |Materials|{{RootFieldType|SyncAssetList`1|[[Type:Material|Material]]}}|TypeAdv9=true|The Material(s) to render with | ||
|LineHeight|Float|How high each line of text is | |LineHeight|Float|How high each line of text is | ||
|MaskPattern|String|TBD | |MaskPattern|String|TBD | ||
|HorizontalAutoSize|Bool|Automatically adjusts the text's size to fit in its horizontal space | |HorizontalAutoSize|Bool|Automatically adjusts the text's size to fit in its horizontal space | ||
|VerticalAutoSize|Bool|Automatically adjusts the text's size to fit in its vertical space | |VerticalAutoSize|Bool|Automatically adjusts the text's size to fit in its vertical space | ||
|AutoSizeMin|Float|The minimum size that can be reached via auto-sizing | |AutoSizeMin|Float|The minimum size that can be reached via auto-sizing | ||
Line 34: | Line 34: | ||
|CaretPosition|Int|TBD | |CaretPosition|Int|TBD | ||
|SelectionStart|Int|TBD | |SelectionStart|Int|TBD | ||
|CaretColor| | |CaretColor|ColorX|TBD | ||
|SelectionColor| | |SelectionColor|ColorX|TBD | ||
|InteractionTarget|Bool|TBD | |InteractionTarget|Bool|TBD | ||
|_legacyFontMaterial|FontMaterial|Internal | |_legacyFontMaterial|'''[[Component:FontMaterial|FontMaterial]]'''|TypeAdv21=true|Internal | ||
|_legacyAlign|Alignment|Internal | |_legacyAlign|Alignment|Internal | ||
}} | }} | ||
Line 63: | Line 63: | ||
== Related Components == | == Related Components == | ||
</translate> | </translate> | ||
[[Category:Components{{#translation:}}|Text | [[Category:Components{{#translation:}}|Text]] | ||
[[Category:ComponentStubs]] | [[Category:ComponentStubs]] | ||
[[Category:Components:UIX:Graphics{{#translation:}}|Text | [[Category:Components:UIX:Graphics{{#translation:}}|Text]] |
Revision as of 21:37, 3 March 2024
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
Introduction
This component displays text inside of a UIX canvas. It also supports text formatting.
Usage
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
Font
|
FontSet | The font to use |
Content
|
String | What to display |
ParseRichText
|
Bool | Whether or not to interpret text formatting |
NullContent
|
String | What to display if Content is empty |
Size
|
Float | The size to render text at, in display units |
HorizontalAlign
|
TextHorizontalAlignment | How to align the text, horizontally |
VerticalAlign
|
TextVerticalAlignment | How to align the text, vertically |
AlignmentMode
|
AlignmentMode | How to compute alignment |
Color
|
ColorX | The color to render the text with |
Materials
|
list of Material | The Material(s) to render with |
LineHeight
|
Float | How high each line of text is |
MaskPattern
|
String | TBD |
HorizontalAutoSize
|
Bool | Automatically adjusts the text's size to fit in its horizontal space |
VerticalAutoSize
|
Bool | Automatically adjusts the text's size to fit in its vertical space |
AutoSizeMin
|
Float | The minimum size that can be reached via auto-sizing |
AutoSizeMax
|
Float | The maximum size that can be reached via auto-sizing |
CaretPosition
|
Int | TBD |
SelectionStart
|
Int | TBD |
CaretColor
|
ColorX | TBD |
SelectionColor
|
ColorX | TBD |
InteractionTarget
|
Bool | TBD |
_legacyFontMaterial
|
FontMaterial | Internal |
_legacyAlign
|
Alignment | Internal |
Examples
Here we start with a parent that has a VerticalLayout component with ForceExpandWidth and ForceExpandHeight set.
The first child contains text, with no LayoutElement.
The second child is an Image with a LayoutElement set to its defaults.
As we see, rather than having equally-weighted children, the image child is squashed. In part this is because the image child has no preferred height, but also the text seems to have a preferred height that includes some empty space underneath it.
Setting various values in the LayoutElement of the image child does expand that child. For example, setting its FlexibleHeight to 1 or its PreferredHeight to 100.