So I have a dialog system that supports richtext and for some odd reason, whenever the 2nd dialog shown in this video gets played the 1st one’s italics become bold.
It’ll hopefully make more sense when you watch the video. (my apologies if it’s a little low quality I had to compress it)
The code for this is displayed below, I don’t know how this could possibly be affecting anything…
If you need further explanation please tell me.
local function typewrite(str: string,shadowStr: string?,label: TextLabel,speed: number,speedChanges: {})
--The variables that matter are str, which is the text being displayed, and label, which is the text label being changed here.
label.MaxVisibleGraphemes = 0
label.Text = str
local display = label.ContentText
label.Shadow.Text = shadowStr or display
label.Shadow.MaxVisibleGraphemes = 0
local count = 0
for _ in utf8.graphemes(display) do
count += 1
end
for i = 1, count do
label.MaxVisibleGraphemes = i
label.Shadow.MaxVisibleGraphemes = i
sound:Play() --"sound" does exist, don't worry, this is simply a snippet of the entire code.
if speedChanges[i] then
speed = speedChanges[i]
end
local currentchar = display:sub(i,i)
if currentchar~=" " then
task.wait(speed)
end
--end
end
end
I have already tried printing out the text that’s in the TextLabel, the RichText tags showing up are the correct ones, which are the <i>text</i>
ones.
There’s a possibility that this could just be some odd bug but I want to know if I could fix this…?