Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to change position of a text label?

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.

1 comment

0

The property Position takes a UDim2 which needs to be constructed. See https://wiki.roblox.com/index.php?title=UDim2 for more info.

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.