How to curve text!

Roblox may not allow you to curve text but with most things on roblox you can do about anything with a few good workarounds!

Now we are gonna do a pretty backwards way at going about it but it works and functions and thats all that matters and is good enough for most people. First we need a string of course so lets set that up:

local RawText = "This is my string!"
-- Now we have to filter it so roblox doesnt get mad at us..
local TextService = game:GetService("TextService")
local Text = TextService:FilterStringAsync(RawText, fromPlayerId)

Now that we have that set up lets make the function to set up our pseudo text box

for i = 1, #Text do
   local char = Text:sub(i,i)
   local letter = Instance.new("TextLabel")
   letter.BackgroundTransparency = 1
   letter.Size = UDim2.new(0,10,0,15) -- Set our letter's size
   letter.Text = char
   letter.FontSize = Enum.FontSize.Size8 -- Change as needed

   -- Now for our UDim2 math dont worry about this its all set in motion for you

   local angle = math.rad((i-1) * 2 --[[ The angle to curve it by you can also alter this if you know what youre doing to make for example a wave ]])

   local radius = 90

   local xOffset = math.cos(angle) * -radius
   local yOffset = math.sin(angle) * -radius

   local rotationAngle = math.deg(math.atan2(yOffset, xOffset)) 
   letter.Rotation = rotationAngle + 90 -- Our +90 is to make sure the letters are facing the right way around

   -- Now finally parent the letter!
   letter.Parent = -- Your instance
end

This is a pretty powerful tool if you also wanted to animate individual letters in a string ive seen little to no documentation on how to do this stuff so i figured id make something for it!

Hope this is useful for anyone who finds it!

8 Likes

Filtering your own text isn’t needed! Only the strings you don’t have control over (user-generated content) has to be filtered.

Anyway, nice workaround, just wonder if there are much use cases for this. Curved text is pretty much 2010 stuff (except for things like circle labels and smartwatches)

3 Likes

Feel like it would be used more for the individual letters to be animated than being rotated but at least its out there so people can know how to do it. Actually made this for a curved label myself and decided to share it since no ones ever really documented it!

1 Like