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
richtext.create("I am <boldred>bold and red</boldred>!", "Roboto", settings)
161
+
```
162
+
146
163
147
164
# API
148
165
### richtext.create(text, font, settings)
@@ -173,6 +190,7 @@ The `settings` table can contain the following values:
173
190
174
191
The `fonts` table should have the following format:
175
192
193
+
```lua
176
194
name (string) = {
177
195
regular (string) =font (hash),
178
196
italic (string) =font (hash),
@@ -182,11 +200,13 @@ The `fonts` table should have the following format:
182
200
name (string) = {
183
201
...
184
202
},
203
+
```
185
204
186
205
Where `name` is the name specified in a `<font>` tag and the `font` for each of `regular`, `italic`, `bold` and `bold_italic` should correspond to the name of a font added to a .gui scene.
187
206
188
207
The `layers` table should map fonts, textures and spine scenes to layer names. It should have the following format:
189
208
209
+
```lua
190
210
fonts= {
191
211
font (hash) =layer (hash),
192
212
...
@@ -202,6 +222,7 @@ The `layers` table should map fonts, textures and spine scenes to layer names. I
202
222
...
203
223
spinescene (hash) =layer (hash),
204
224
}
225
+
```
205
226
206
227
Where `layer` is the name of a layer in the .gui scene, `font` is the value returned from a call to `gui.get_font(node)`, `texture` is the value returned from a call to `gui.get_texture(node)` and finally `spinescene` is the value returned from a call to `gui.get_spine_scene(node)`.
Copy file name to clipboardexpand all lines: example/example.gui_script
+11-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
local richtext = require "richtext.richtext"
2
2
local color = require "richtext.color"
3
+
local tags = require "richtext.tags"
3
4
4
5
local sherlock = [[At three o'clock precisely I was at Baker Street, but Holmes had not yet returned. The landlady informed me that he had left the house shortly after eight o'clock in the morning. I sat down beside the fire, however, with the intention of awaiting him, however long he might be. I was already deeply interested in his inquiry, for, though it was surrounded by none of the grim and strange features which were associated with the two crimes which I have already recorded, still, the nature of the case and the exalted station of his client gave it a character of its own. Indeed, apart from the nature of the investigation which my friend had on hand, there was something in his masterly grasp of a situation, and his keen, incisive reasoning, which made it a pleasure to me to study his system of work, and to follow the quick, subtle methods by which he disentangled the most inextricable mysteries. So accustomed was I to his invariable success that the very possibility of his failing had ceased to enter into my head. It was close upon four before the door opened, and a drunken-looking groom, ill-kempt and side-whiskered, with an inflamed face and disreputable clothes, walked into the room. Accustomed as I was to my friend's amazing powers in the use of disguises, I had to look three times before I was certain that it was indeed he. With a nod he vanished into the bedroom, whence he emerged in five minutes tweed-suited and respectable, as of old. Putting his hands into his pockets, he stretched out his legs in front of the fire and laughed heartily for some minutes. 'Well, really!' he cried, and then he choked and laughed again until he was obliged to lie back, limp and helpless, in the chair. 'What is it?' 'It's quite too funny. I am sure you could never guess how I employed my morning, or what I ended by doing.' 'I can't imagine. I suppose that you have been watching the habits, and perhaps the house, of Miss Irene Adler.' 'Quite so; but the sequel was rather unusual. I will tell you, however. I left the house a little after eight o'clock this morning in the character of a groom out of work. There is a wonderful sympathy and freemasonry among horsey men. Be one of them, and you will know all that there is to know. I soon found Briony Lodge. It is a bijou villa, with a garden at the back, but built out in front right up to the road, two stories. Chubb lock to the door. Large sitting-room on the right side, well furnished, with long windows almost to the floor, and those preposterous English window fasteners which a child could open. Behind there was nothing remarkable, save that the passage window could be reached from the top of the coach-house. I walked round it and examined it closely from every point of view, but without noting anything else of interest. 'I then lounged down the street and found, as I expected, that there was a mews in a lane which runs down by one wall of the garden. I lent the ostlers a hand in rubbing down their horses, and received in exchange twopence, a glass of half and half, two fills of shag tobacco, and as much information as I could desire about Miss Adler, to say nothing of half a dozen other people in the neighbourhood in whom I was not in the least interested, but whose biographies I was compelled to listen to.']]
5
6
@@ -305,6 +306,14 @@ end
305
306
local function create_repeat_example()
306
307
local settings = { position = vmath.vector3(320, 450, 0), align = richtext.ALIGN_CENTER, fonts = { Roboto = ROBOTO } }
0 commit comments