Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do I change the size and position of the TextLabel with script?

Asked by
lytew 99
4 years ago

I wanted to change the size and position of a textlabel but I don't know how ... I tried vector3 but it didn't work

0
UDim2, not Vector 3 EmbeddedHorror 299 — 4y
0
Yes IwanL17 5 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

If you want to change the size and position of it then do this:

local TextLabel = script.Parent

TextLabel:TweenSizeAndPosition(UDim2.new(SizeX, 0, SizeY,0), UDim2.new(PositionX, 0, PositionY, 0),"Out","Style",Time)

Customise the SizeX and SizeY to the Size you want it to be. Customise the PositionX and PositionY to the Position you want it to be. I would recommend leaving the offset values to 0.

Customise the Style and the Time to the animation style you want and how long you want the animation to take (in seconds).

Here is a page you can look at for the animation styles:

Easing Styles

Here is an example if you don't quite understand:

--Example:

local TextLabel = script.Parent

TextLabel:TweenSizeAndPosition(UDim2.new(0.5, 0, 0.2,0), UDim2.new(0.1, 0, 0.6, 0), "Out", "Bounce", 1.1)

Ad

Answer this question