You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| a | Create a "hyperlink" that generates a message |`<a=message_id>Foobar</a>`|
33
33
|| when clicked (see `richtext.on_click`) ||
34
34
| b | The text should be bold |`<b>Foobar</b>`|
@@ -51,6 +51,9 @@ The following tags are supported:
51
51
| nobr | Prevent the text from breaking |`Words <nobr>inside tag</nobr> won't break`|
52
52
| size | Change text size, relative to default size |`<size=2>Twice as large</size>`|
53
53
| spine | Display spine model |`<spine=scene:anim/>`|
54
+
| p | Adds extra spacing below the line where this |`<p>A paragraph</p>\nSome other text`|
55
+
|| tag ends. Adds a newline before its opening |`<p=2.5>This has 2.5 lines of spacing<p>`|
56
+
|| tag if it doesn't already exist. ||
54
57
55
58
### Line breaks
56
59
Note that there is no need for the HTML `<br/>` tag since line breaks (i.e. `\n`) are parsed and presented by the system. Note that a single `<br>` (ie without a closing or empty tag) isn't supported (even though most browsers accept it).
@@ -150,6 +153,7 @@ The `settings` table can contain the following values:
150
153
*`outline` (vector4) - The default outline color of text. Will be transparent if not specified.
151
154
*`align` (hash) - One of `richtext.ALIGN_LEFT`, `richtext.ALIGN_CENTER`, `richtext.ALIGN_RIGHT` and `richtext.ALIGN_JUSTIFY`. Defaults to `richtext.ALIGN_LEFT`. Defines how the words of a line of text are positioned in relation the provided `position`. Width must be specified for `richtext.ALIGN_JUSTIFY`.
152
155
*`line_spacing` (number) - Value to multiply line height with. Set to a value lower than 1.0 to reduce space between lines and a value higher than 1.0 to increase space between lines. Defaults to 1.0.
156
+
*`paragraph_spacing` (number) - Space to leave after lines with where `<p>` tags end. Relative to the line height. Defaults to 0.5 lines.
153
157
*`image_pixel_grid_snap` (boolean) - Set to true to position image on full pixels (positions rounded to nearest integer) to avoid effects of anti-aliasing. Defaults to false.
154
158
*`combine_words` (boolean) - Set to true to combine words with the same style on a line into a single node. This is useful for very long texts where the maximum number of nodes would exceed the limit set in the GUI. The disadvantage is that any per word operations will not work since the words have been combined.
local settings = { position = vmath.vector3(10, 1075, 0), width = 600 }
22
+
local text = "<p>This is some rather long text that wraps around and has 0.5 lines of space after its last line.</p>\n<p=2.5>This one has 2.5 lines of space.</p>\nThis is just regular text."
0 commit comments