I’m trying to obtain the absolute x, y position on the screen of an ImageButton.
But
print(game.StarterGui.ScreenGui.MyFrame.MyImageButton.AbsolutePosition)
shows
attempt to index function with ‘AbsolutePosition’
How can I get the absolute x, y position on the screen of an ImageButton?
1 Like
print(tostring(game.StarterGui.ScreenGui.MyFrame.MyImageButton.AbsolutePosition))
1 Like
un1ND3X
(ice)
#3
local object = script.Parent -- parent being the Gui object
print(object.AbsolutePosition.X, ",", object.AbsolutePosition.Y)
Edit:
If you put the script under the GuiObject you want it to print the AbsolutePosition for, that’s just what it’ll do…
1 Like
That’s the parent’s position, not the ImageButton position…
1 Like
128Cores
(Kellie)
#6
It’s a place holder you can change the script.
1 Like