Rich text scaling

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? The text to be the same size and not flicker with letters

  2. What is the issue?
    robloxapp-20230124-1357130.wmv (567.9 KB)

  3. What solutions have you tried so far? changing the size of a font, disabling auto scaling

So when i type in 1 letter before the last letter, the whole text is changing size, so the last letter of the first row is put in the first letter of the second row, and the last letter of a second row is put to the first letter of the third row, and i don’t want this to happen

local keysFrame = script.Parent.KeysFrame
local keysArray = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "u", "i", "o"}
local keysLabel = keysFrame.KeysLabel
local keysInLabel = ""
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local nonChangedText = ""

--Unbind I abd O button for work purposes
local ActionS = game:GetService("ContextActionService")
ActionS:BindActionAtPriority("do nothing", function() return Enum.ContextActionResult.Sink end, false, 3000, Enum.KeyCode.I, Enum.KeyCode.O)


for i = 1, 30 do
	local randomLetter = keysArray[math.random(1, #keysArray)]
	if keysInLabel == "" then
		keysInLabel = randomLetter
	else
		if keysInLabel:sub(#keysInLabel, #keysInLabel) == randomLetter then
			local newKey = ""
			repeat
				wait()
				newKey = keysArray[math.random(1, #keysArray)]
			until keysInLabel:sub(#keysInLabel, #keysInLabel) ~= newKey
			keysInLabel = keysInLabel.." "..newKey
		else 
			keysInLabel = keysInLabel.." "..randomLetter
		end
	end
end

keysLabel.Text = keysInLabel
nonChangedText = keysLabel.Text

uis.InputBegan:Connect(function(input, gameProcessed)
	if keysInLabel == "" then return end
	if gameProcessed then
		if (input.KeyCode.Name.lower(input.KeyCode.Name) ~= keysInLabel:sub(1,1)) then
			return
		end
	end
	
	if (input.KeyCode.Name.lower(input.KeyCode.Name) == keysInLabel:sub(1,1)) then
		keysInLabel = keysInLabel:sub(3)
		local richTextOfKeysLabelStart = '<font size="75">'
		local richTextOfKeysLabelEnd = '</font>'
		
		local StartOfAString = string.gsub(nonChangedText, keysInLabel, "")
		
		keysLabel.Text = richTextOfKeysLabelStart..StartOfAString..richTextOfKeysLabelEnd..keysInLabel
	end
end)

Please convert the video to an mp4, or record with something other than roblox.


Here :slight_smile: