Is it possible to get the coordinates of a GUILayout element, i.e. the x,y value of its Rect?
In my case I have a textured button that I'm using as color picker. When the mouse is clicked over the button I get the mouse coords from the event and intend to use them to calculate the relative offset into the button/texture and the get the pixel color from that location.
This all works fine when I use GUI.RepeatButton and set the button's rectangle explicitly. In this case I have the coords for the button.
Now, however, I would like to embed my color picker in an existing GUI that uses all GUILayout elements. In order to use GUILayout.RepeatButton I will need some means to get the button's x,y coord when it is clicked. My searches for such a means have thus far come up empty.
Thanks!
Malveka