Hello, I was wondering how I can make a text label’s text size scale in one direction not both when you use automatic scale. I already tried to use anchor point but it did nothing. Please help!
Change the size constraint to what? I want the text to scale like become bigger only to the right not both sides.
In that case, then simply set the X value of the AnchorPoint
to 0.
That will make it scale only to the right like this:
I’m trying the make the thing in Caliber when you kill someone the text says their name after kill
Example 1:
Example 2:
See how they’re both at the same spot and not colliding with kill? The text grows to the right. So does the size.
You don’t need to mess with scale at all, just make the frame the entire possible width of the text, then set the TextXAlignment
property to Left
. It should now always scale to the left. Additionally, if you are trying to make this out of multiple TextLabel
s, this is not how you are supposed to do that. You need to use RichText in conjunction with a script.
Change the size and position at the same time.
What does rich text even do? All it does for me is remove the stroke of my text.
It allows a whole plethora of features that can happen mid-text within the same TextLabel
, instead of creating and customizing multiple TextLabel
s if you intend to use multiple different parts within the same line.
Please read this article.
Is that how people make 1 text label that has different effects? That is really complicated how can someone remember all of that?
Yeah, and you can also set a playername into it using a script.
But then it’s really complicated if you want to tween the first part then the second part. How would you do that?
The entire point of RichText is that it is one object, you do not have to tween multiple parts, everything you need will be in the same TextLabel
.
This is a test LocalScript
that when put under a TextLabel
, will put Player: in bold and then your name in normal text with RichText.
script.Parent.Text = ("<b>Player:</b> " .. game.Players.LocalPlayer.Name)
Wow it smoothly turns bold. That is really cool.
But how would I turn my situation into a rich text thing.
Right now it’s just a text label with a uistroke and another text label.
Your situation is a bit complicated, but I’ll reply as soon as I get it working in the intended way.
Ok. That would probably work A LOT better than what I had before. It was a scripting mess.
Object1.Transparency = 1
Object2.Transparency = 1
Just put kill! “example”
<font color="#ff0000" size="24">KILL!</font> example
The above line will have the following results:
The example text will inherit the size and color set in the TextLabel
‘s properties, and kill will always be red and large. Both use the properties’ stroke.
Where should I put this code??
When you go to set the text using a LocalScript
.
script.Parent.Text = ("<font color="#ff0000" size="24">KILL!</font>" .. game.Players.LocalPlayer.Name)