- Home /
How do you find the rect of a GUILayout item?
I'd like to use GUILayout items for a HUD thing I'm making, but I need to find the screen coords of the layout items, since Layout moves/sizes things for me. I can get the rect of the containing window, but can I get them for buttons and labels in the window?
Answer by DaveA · Mar 25, 2011 at 09:48 PM
Ah: GUILayoutUtility.GetLastRect()
For my purposes, it seems, I would have to store each in an array so I can get at it in my Update function.
That's what I was going to suggest, but typically you know more about this stuff than I do so I assumed you already explored that avenue. lol
Thanks. I forgot about that Utility class. Google works wonders, easy to forget.
Your answer
![](https://koobas.hobune.stream/wayback/20220613114906im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
MouseOver for multiple GUILayout.Buttons? 1 Answer
Finding position of button in guilayout grid 0 Answers
texture click detection is off 1 Answer
GUILayout.button size is not changin 2 Answers
How to set rectangle size in GUILayout 0 Answers