Is Mouse Over the Window or Rect?
Code: Finding the real Rect when using GUI.matrix in Unity3d
Catering for 3d stereoscopic, all my Unity gui code needs automatically duplicate itself for two screens – horizontal span, so I have a built in library that handles this heavily relying upon GUI.matrix for scaling and GUI.windows for duplicating buttons, dialogues, panels etc.
All is well and good until you want to find if the mouse is over a window or button in an accurate manner, providing your own rect and doing some mouse position to gui space does not necessarily work, especially if the gui has been scaled etc, so here are a couple of little hack-fu’s / work arounds.
Read More…


