GUI.matrix and hovering

So I’m using the GUI.matrix variable to scale a complex GUI system with the screen resolution, and I’ve just hit a major snag. All the visual GUI elements scale beautifully with the matrix, but it would seem that their individual hover Rect’s do not. As soon as i scale the matrix from it’s default size, I lose all hover interactivity. I’m assuming this has to do with mouse positions not scaling with the matrix, but I’m sure hoping somebody has a more definitive answer and hopefully a solution.

well, i’ve done some tests using the default skins, and the onHover notification works fine with a scaled matrix on them. I’m using GUILayout for most of my controls, but that also seems to be working fine with the default skin and a scaled matrix.

So maybe it has something to do with the texture sizes i’m using for the normal and hover style states in my skins?? Any thoughts?

Again, all my hover displays work fine before i scale the matrix.

I also discovered this… don’t use rects… use GUILayout and width/height to adjust sizes and begin horizontal/vertical to build your layout.

I reported this as a bug ages ago… but have not heard anything about it.

Seon, do you have a bug number for that report - I’d hate to see something like this seeping thropugh the cracks

Nicholas, while I’ve got you on topic here, I wanted to ask a couple questions. Due to privacy issues I’m unable to post anything from the actual GUI system I’m working on, but, time allowing, I’ll try and reproduce the effect i’m seeing using the default skin and post that.

1.) Are there any known reasons why GUI systems, scaled by a matrix, would behave differently than if they weren’t?

2.) The GUI I’m building requires multiple GUI elements to be layered on top of each other in the same OnGUI call (and there are multiple OnGUI scripts behaving in this way). I’ve been achieving this through the use of GUILayout’s Areas that overlap, but are ordered in code, and the system has been working fine at my default resolution. But this is an area I’m concerned is being affected by the matrix scale, as the Area’s require defined, and often overlapping, Rect’s to space the elements correctly.

Any thoughts on this matter would be greatly appreciated.

Nicholas, i also found this topic: http://forum.unity3d.com/viewtopic.php?t=7718&postdays=0&postorder=asc&start=0
from a couple of months ago, with a post from Jonathan Czeck discussing how mouseEvents broke once the GUI.matrix came into play. Has anything changed since your reply to him at that time?

I didn’t submit a proper bug report on it. Please show me up and submit one and they’ll be sure to fix it. It should just work.

-Jon

Well we’re into 2013 and this bug is still in the system! I’ve reported it as case number 550452… Hopefully this can finally be fixed in time for the new GUI system right? :wink: