Hello Developers!!
Today, I have a little bug in my GUI here. My rich text works fine but it update the color little bit slow, if you have any solution please tell me. Here is my video:
Hello Developers!!
Today, I have a little bug in my GUI here. My rich text works fine but it update the color little bit slow, if you have any solution please tell me. Here is my video:
You haven’t included any script, but I’m assuming it’s because your rich text tags are being added slowly and thus show up before the end of the tag finally loads into the textbox
You could segment your text into chunks and have some chunks load before others
TextLabel.Text = ("%s<openingtaghere>%s</openingtaghere>%s"):format("Hello", "TextYouWantTheTagToInclude", "ClosingText")
Here is my text table, I’m sorry for not sending script!!
local Conversations = {
['PlayerConversation'] = {
'Where am I..? I can’t see.';
Player.Name;
'I am supposed to be - <font color="rgb(255,0,0)">'..Player.Name..'</font>';
};
['ZyinkConversation'] = {
'...';
'Welcome <font color="rgb(0,255,0)">traveler</font>, what shall I call you?';
'Ah I’ve heard of that <font color="rgb(255,0,0)">name</font>, '..Player.Name..'.';
'Well '..Player.Name..'. What <font color="rgb(255,0,0)">path</font> shall you take now?';
};
['MysteryNPCConversation'] = {
'Who are you supposed to be?';
'I will choose my own path to follow. A vibrant white portal appears before you..';
'you feel a darkness grow inside yourself - A 2nd but silt glowing black portal appears behind you..';
'its glowing slightly even though its darkness consumes everything.'
};
}
I kinda don’t understand what you want me to do with this code here. Can you please explain how your code work please?
You should check out the MaxVisibleGraphemes property, it was made with this functionality in mind.
What do I do with that property?
I’ve never heard of this property, it looks great and is way better than my solution lol
Hello, do you know how can I set it up??
Your typewriting code should be rewritten so that the MaxVisibleGraphemes property is slowly incremented towards the amount of graphemes(characters) that the text contains
It means how many characters are visible if it is -1
all characters are visible if it is 0
none are visible, 1
only the first character is visible, using tween or runservice you can set it up to how many characters in total NOT counting the XML tags.
I’m so sorry, but I’m very confused about what everyone try to tell me what to do with the property of the text label in the typewriting script. Please give me an example or any other article!!
Well im sorry, but here is one of of the documents here,
BUT I HIGHLY RECOMMEND YOU MESS AROUND WITH THE MaxVisibleGraphemes
Attribute
Like put down a random RichText object and set MaxVisbleGraphemes to 2 or 5 maybe 11 or -1 maybe that will help you understand it
but in the document specifically in one of the scripts on line 20 that says
function AnimateUI.typeWrite(guiObject, text, delayBetweenChars)
guiObject.Visible = true
guiObject.AutoLocalize = false
local displayText = text
-- Translate text if possible
if translator then
displayText = translator:Translate(guiObject, text)
end
-- Replace line break tags so grapheme loop will not miss those characters
displayText = displayText:gsub("<br%s*/>", "\n")
displayText:gsub("<[^<>]->", "")
-- Set translated/modified text on parent
guiObject.Text = displayText
local index = 0
for first, last in utf8.graphemes(displayText) do
index = index + 1
guiObject.MaxVisibleGraphemes = index
wait(delayBetweenChars)
end
end
The translations are not really important, but on the loop that says utf8.graphemes
there is a wait, and index keeps increasing from 0, It is being set to the MaxVisibleGraphemes.
Ok, thank you. I will try this out!!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.