- Home /
Unity3d 4.6 GUI Buttons Interaction Broken after Maximizing Window
I hope I can explain this well enough: I have a some buttons on the screen created with the new GUI system. When I launch my application in a windowed mode and interact with the buttons everything is fine. If I re-size the window everything still works great. But if I maximize the window the button interaction breaks. It is as if the bounding boxes do not scale and position correctly.
My camera is orthographic and the canvas is Screen Space Overlay. Anyone else run into this?
Just encountered this issue. I tried updating Unity using the latest patch at http://unity3d.com/unity/qa/patch-releases and it seems to have fixed it.
Thanks for the heads up. I tried it and it did not seems to work for me. It looks like it happens if I scale a window by dragging the frame by primarily its height or width, especially if I drag a window border by only the right or bottom border and make it much taller or wider. I think I am going to have to disallow re-sizing the window arbitrarily, not a big loss.
I am encountering a very similar problem. I have two cameras, one for rendering 3d UI elements, set to ortographic mode. I also have four buttons, which I have resized, also rendered in this other camera. What happens is, the buttons "mouse over detection" so to speak are broken, about at the half of the buttons length, the next button gets highlighted. Quite an interesting problem and I am not sure which part is the culprit.
There is a bug in the Issue Tracker, looks like this might be it. Hope it gets fixed. Check out:
Answer by Mmmpies · Jan 16, 2015 at 08:10 PM
Sounds more like another transparent panel has scaled over the buttons. If they don't react at all that's the most likely case.
Move the buttons to the bottom of the Canvas that way they're on top as far as the UI is concerned so if a panel has scaled over them it'll be behind them.
Give it a shot anyway.
EDIT
I don't know your setup but create that simple example again and this time try moving the anchors of each element to the corners of that element, so let's say you've got a full screen Canvas with a slightly smaller panel then move the anchors of that panel to the corners of the panel itself.
You should see the RectTransform numbers get closer to 0 as you get each anchor to the corner and in fact you can then set them to 0 in the Inspector.
Then you have several child buttons on that panel, set those button the same so each ones anchors are at the corners of the buttons.
What this should do is scale the elements exactly like the parent. It might not be what you want for everything but should fix this issue unless it's something else that's causing it.
Thanks $$anonymous$$mmpies, that helped me understand the new GUI system a bit more. However I am still having the issue. The strange thing is that it seems almost random (it probably isn't though). There is a lot going on in my app with the GUI so it could be something I am doing wrong. But I did a test with a very simple scene by creating a Canvas and putting 5 buttons of various sizes around the screen. I then did a build with "re-sizable window" and ran it. I can get the issue to happen even with that simple scene buy re-sizing the window a bunch of times and by maximizing and $$anonymous$$imizing the window.
If I do not build with "re-sizable window" and just explicitly set a window size via code the problem never happens.