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

How do you find the x position of a gui?

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

✓ Accepted answer

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

3 comments

0

ok thanks for the quick answer

0

No problem :)

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.

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