I have a BillboardGui, a frame (with more textframes in it) in order to create the effect of a normal text frame with a long string. You might ask “why do they need all of those text frames” – the answer to that is because I need to individually manage each letter of the text (position, color, size, etc) to make nametag effects in my game.
What do I need help with? I need to make sure the size is consistently the same with all of the letters and frames just as you would if there was one frame with TextScaled on.
Here’s my current code:
local text = player.Name
local TextFontSize = 30
local TextSize = game.TextService:GetTextSize(text, TextFontSize, Enum.Font.Gotham, Vector2.new(usernameFrame.Size))
for i = 1, #text do
local CharacterLabel = Instance.new("TextLabel")
CharacterLabel.ZIndex = 2
CharacterLabel.BackgroundTransparency = 1
CharacterLabel.Font = Enum.Font.Gotham
CharacterLabel.TextSize = TextFontSize
CharacterLabel.Size = UDim2.new(0, 1/#text, 0, 1)
CharacterLabel.Position = UDim2.new((i-1)/#text, 0, 0.5, 0)]
CharacterLabel.AnchorPoint = Vector2.new(0.5, 0.5)
CharacterLabel.Text = string.sub(text, i, i)
CharacterLabel.Parent = usernameFrame
end
This is the issue:
https://cdn.discordapp.com/attachments/1138164798652166264/1186204672437006356/Screen_Recording_2023-12-18_at_1.12.47_AM.mov?ex=65926630&is=657ff130&hm=8a733ed902d1778d0e07e6c895a044b3b1e2e33979b9935fa8bdd2635bda006c& (File too big so had to make do)
I want each letters to be evenly spaced, appear how it normally would, and when manipulating the camera scale and position properly inside of the frame.