Description
There are two Text Asset options:
- Simple Text Asset
- Rich Text Asset
The main differentiator concerns formatting and binding:
- Use Simple Text if you need to perform binding for each individual formatting option. Formatting, regardless of how it is set, impacts the entire text entry.
- Use Rich Text if you need to perform binding for HTML-formatted content. Formatting, regardless of how it is set, can be applied to text fragments, not just to the entire text entry.
If you don't need to present HTML formatted content or if you don't know which Text Asset you should use, always start using the Simple Text. It will be lighter and easier to maintain in your experience.
About fonts
See our article about fonts for details. In summary, Intuiface supports both TrueType and OpenType fonts.
Scrolling through text
To create scrollable text - i.e. to display a subset of the overall text and enable a user to scroll through the remaining text - use the "Adapt font size" and "Overflow behavior" properties.
Here's how it works:
- Enable the "Adapt font size" property for the Text Asset.
- A new property appears, named "Minimum font size". Specify a font size below which you do not want the text to shrink. The maximum size is determined by the "Font size" property.
- Set the "Overflow behavior" property to "Scrollbars"
With "Adapt font size" enabled, the font size of text will scale down to the minimum, adapting to the size of the container in which it appears. If the minimum is reached and text continues to overflow the container, scrollbars will appear. In Player or in Composer's Play Mode, a swipe gesture enables scrolling through the text.
NOTE: Sparingly use "Adapt font size" and "Overflow behavior": Activating the "Adapt font size" property, and using anything other than the default "Overflow behavior" of "Clip", can cause slow scene loading times because of high computational requirements, particularly on Player platforms other than Windows. Only use this feature when required for your design.
Properties, Triggers & Actions
Properties for Simple Text
See our list of common properties for details about properties shared by all asset types.
The Simple Text asset is used to share textual information with your audience. It provides a variety of formatting options that can be freely used with binding.
Text
- Text: (located in the More Properties panel) contains the text you want to display.
- Font: sets the font of text
- Font color: sets color of text
- Font size: sets size of text
- Adapt font size: toggle whether the font size of text should shrink in order to maintain visibility within its container.
- Minimum font size: The size below which "Adapt font size" will not shrink the text.
- Overflow behavior: specify how to represent text that cannot be seen within its container because it doesn't fit. Options are:
- Clip: There is no visual indication that additional text is not displayed.
- Ellipsis: Displays a "..." at the end of the visible text.
- Scrollbars: Displays a scrollbar and enables - in Player and Composer's Play Mode - the ability to scroll through text using a swipe gesture.
- Bold: toggles whether text is displayed in bold
- Italic: toggles whether text is displayed in italics
- Underline: toggles whether text is underlined
- Line Wrap: toggles whether to respect the right-end of the container and continue text on the next line
- Horizontal / Vertical Alignment: sets positioning of text within the Simple Text container
Properties for Rich Text
See our list of common properties for details about properties shared by all asset types.
The Rich Text asset provides richer formatting possibilities than the Simple Text asset, including a variety of additional alignment options (alignment, bullets, spacing, super/subscript), the ability to vary formatting in the same text block and support for the HTML formatting syntax:
Text content can be modified directly in a scene simply by clicking anywhere within its container. This activates the cursor, enabling the addition of new text, the deletion of existing text and use of the mouse to highlight text targeted for formatting.
NOTE: Because the Rich Text asset accepts HTML-encoded text, most formatting properties are not available for binding. Only the text itself is available for/modifiable by binding.
Text
- HTML Text: contains the text you want to display. This field accepts well-formatted HTML, enabling you to combine text with formatting. The following HTML tags are accepted; all other tags are ignored.
- <b> bold
- <i> italic
- <span> for defining text color and size
- <p> for paragraphs
- <div>
- <table> <tr> and <td> for defining tables
- <br> line break
- <li> <ul> and <ol> for lists
The following properties are available in the Properties panel for the Rich Text asset.
- Font color: sets color of selected text
- Font size: sets size of selected text
- Font: sets the font of selected text
- Bold: toggles whether selected text is displayed in bold
- Italic: toggles whether selected text is displayed in italics
- Underline: toggles whether selected text is underlined
- Alignment: sets positioning of selected text to Left Aligned, Right Aligned, Centered or Justifed
- Bullet: toggles whether selected text should appear in a bulleted list
- Numbering: toggles whether selected text should appear in a numbered list
- Increase Indent: increases paragraph indentation
- Decrease Indent: decreases paragraph indentation
- Subscript: toggles whether selected text will be written as subscript
- Superscript: toggles whether selected text will be written as superscript
Triggers
See Triggers Overview to get details of common triggers shared by all assets or collections
There are no triggers unique to the Simple Text asset or to the Rich Text asset.
Actions
See Actions Overview to get details of common actions shared by all assets or collections
The following actions are unique to the Simple Text and Rich Text asset.
Note that other than the Set Text action, all other actions for the Rich Text asset affect the entire text entry and cannot be used to modify text fragments.
- Set text: this action changes the currently displayed text
- Set font: this action sets the font of all parts of the text
- Set font color: this action sets the font color of all parts of the text
- Set font size : this action sets the font size of all parts of the text
- Set font style: this action sets the font style of all parts of the text
Limitations
- Ellipsis (...) will not be displayed if the last visible line is shorter than the text's container.
- Minimum iOS 10.4 and Tizen 4 required for Adaptive Font size, otherwise the expected behavior might not be achieved.
- Rich Text formatting cannot be saved on some specific fonts.
Comments
0 comments
Article is closed for comments.