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

How to change position of a text label?

Asked by 6 years ago
local overheadName = game.Players.LocalPlayer.Character.Head:WaitForChild("OverheadRank")
local player = game.Players.LocalPlayer
local nick = script.Parent.Parent.Nickname

script.Parent.MouseButton1Click:connect(function(j)
overheadName.VIP.Position = {0, 0},{0, -35} --  this is what I'm trying to change...
    overheadName.Special = nick
end)


--{0, 0},{0, -35}

I'm trying to change the TextLabel's position. How do I do that? I've tried many different things and can't seem to get it working.

0
The property Position takes a UDim2 which needs to be constructed. See https://wiki.roblox.com/index.php?title=UDim2 for more info. User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

There's 2 ways you can do this, they are as follows.

script.Parent.Position = UDim2.new(0, 0, 0, 0)

The one above moves it instantly

script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Back", 1)

Above is for experienced UI creators. It slowly moves a GUi across a page to a point. So how do you use it, replace the zeros in that format with the desired position of the GUI after it moves, his goes for the above one too. On the below one, change "In" to either in or out, whichever one fits better, this is the EasingDirection. Replace "Back" with the desired EasingStyle, you can find the easing styles here. Then the number at the end is how long it takes for the guipart to get to the new position. This can be anything.

DM me if you have any more problems.

Ad

Answer this question