- Home /
button doesn't work when in full screen mode
hi all,
hopefully a simple problem here. I have a simple gui button that works fine when in windowed mode but not in full screen mode.
if (GUI.Button (Rect (Screen.width - 128,0,128,27), "", "optionBtn")) { //do stuff }
when in full screen mode, the hover over the button triggers the change in the graphics but the click just doesn't do anything. Am I missing something simple?
Thanks in advance
It's because all your if-test execution code is a comment! :) Joke aside, I've been seeing this problem happen frequently (in other questions). Try this with $$anonymous$$imal code in the gui to rule out other possibilities. if (button) { print it works } sort of style.
For some reason people from Sweden always have a "thing" with humor and jokes, though that is a good thing :)
It's because our women leave us for new men all the time, and our liquor is dead expensive due to heavy taxes and monopoly. To top this off you were smart enough to take on an education that puts you in debt for 30 years and still you're not finding any jobs. The only way to stay happy is pull a bad joke once in a while. :)
Hi, I think it is because of Rect() staff. Right now I am fighting with the appearance of a GUILayout.Window(Rect(),...) that in windowed mode it shows ok but in full stays in the same point as in the windowed mode.
Try to change your Screen.width by a absolute point, e.g., 400 ins$$anonymous$$d of Screen.width
hope you can fix it, and please let me know if you managed, and if so how?
Cheers
other buttons in my gui, created in the same way, work fine in fullscreen mode. It is just this one that sits in the top right corner of the screen. Another strange thing is that if you click around the button a lot, the click will usually register eventually.
Uzquiano - I'll give that a go.
Thanks for the replies and the jokes ;-)
Answer by Konsul · May 02, 2011 at 06:14 AM
I think that I have the same problem. My topic is here: http://forum.unity3d.com/threads/87496-Focus-is-shifted-in-GUI In my case it concerns only some aspect ratios.
Answer by spatton · Aug 27, 2011 at 11:51 PM
It could have to do with Windows being in classic mode of XP style. In Classic mode the shift occurs in fullscreen mode, in XP style it works fine.
Answer by unity_sgstarade · Jan 25, 2019 at 09:11 AM
Whenever you opt to play in fullscreen, first click somewhere in the scene and then go ahead with your gameplay keys. It worked for me.
Your answer
Follow this Question
Related Questions
Full Screen Get smaller when i actived it 1 Answer
full screen and resolution 1 Answer
In-Game Fullscreen Button 1 Answer
The texture fits the screen size but not the display of the score. 0 Answers
GUI.TextField problem, won't update var. 0 Answers