Question about GUI groups

Hi.
Is there a way to know the “world position” of a GUI item on the screen, even if it’s inside a GUI.Group ?

Basically, I have set up a GUI.Group, let’s say with a Rect(10,10,100,100).
And in this group, I create a GUI.Button, for example with a Rect(10,10, 50,50).
I would like to know the top-left position of the button in the world. In that case, it would be 20,20.

Thanks.

There isn’t a function in the API to do this but it is fairly straightforward (just by adding the corner values of the group rectangle to those of the control, which is basically what you have done in your example).

Thanks for your reply andeeee. I already put that in place, but in the precise case I have, it wasn’t enough.
I should have been more precise the first time, so I’ll try to describe exactly the problem I’m facing.

I’m creating an “AdvancedGUI” static class, so that I can use AdvancedGUI function in my script. For instance, I implemented a DialogBox function to display information to the user. Now, I’m working on a ColorPicker function, to allow the user to select a color from a spectrum texture using a GetPixel.

So I have a OnGUI() function in some script that creates a GUI.Group (let’s call it “Group1”).
Within “Group1”, I call a AdvancedGUI.ColorPicker(…) that will create a new group of GUI controls (also using some GUI.Group, that we can call “Group2”).
So I have some kind of GUI hierarchy like : Group1 > Group2 > mySpectrumButton

The bottom line of my first question is : how can I get the exact pixel of the spectrum texture, without (if possible) passing the top-left position of my Group1 as an argument of the ColorPicker(…) constructor.

With some values that gives something like :
Group1 (10, 10, 100, 100)
Group2 (25, 25, 50, 50)
Button (20, 20, 20, 20)
In that case, that would give something like 55,55. But as I do my picking inside Group2, it calculates 55,55 from the top-left position of Group2.

I hope this is clear enough. If not, I’ll try to do a picture to help. Thanks.