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.