Hello,
I hope that everyone is doing well. Quick question… I am creating text using rich text by fading them in. When all the text is faded in, I want it to go get disabled or go away. How might I go about doing this?
Thanks,
V
Hello,
I hope that everyone is doing well. Quick question… I am creating text using rich text by fading them in. When all the text is faded in, I want it to go get disabled or go away. How might I go about doing this?
Thanks,
V
Is this what you’re looking for?
One of the very few things I’ve actually contributed myself!
Thanks for that!
I think I may be using it wrong…
local function remove(self)
richtext.remove(words)
end
function on_message(self, message_id, message, sender)
if message_id == hash("texttime") then
print("text time")
text(self)
timer.delay(7, true, remove)
timer.delay(8, true, text2)
end
end
This segment returns:
/richtext/richtext.lua:645: assertion failed!
In local function text(self)
words is called like:
local words = richtext.create("This is a text that should fade in character by character", "system_font", settings)
Thanks,
V
Yes, you must actually specify which words to delete. Wouldn’t be a useful function if it indiscriminately removed all richtext everywhere!
I don’t see in your code snippet how your richtext is created. Anyway, one thing richtext.create() returns is a table called “words”. You have to store that table when you create the richtext, and then later provide it to richtext.remove().
Sorry, how would I go about storing this table?
self.words = richtext.create(...)
Thank you!