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

How do you find the x position of a gui?

Asked by 8 years ago

I need this for a positioning script so that I can add 100 to the x position. For example,

local xpos= Gui.Xposition --lets say Xposotion would give the current x position or x offset of the gui
Gui.Position=(0,xpos+100,0,0)

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

There is a property of every GUI object named AbsolutePosition. This gives the position of the GUI on the screen in terms of pixels.

local xpos = Gui.AbsolutePosition.X
0
ok thanks for the quick answer Volodymyr2004 293 — 8y
0
No problem :) BlackJPI 2658 — 8y
1
All position and size properties that I can think of have X and Y (and sometimes Z) 'subproperties'. Just remember that they're read-only, so part.Position.X = 100 won't work. Perci1 4988 — 8y
Ad

Answer this question