- Home /
Canvas buttons and fullscreen aspect ratio
Hello guys, I am having a problem and it is really getting on my nerves.
Whenever I build the project and use a resolution which has an aspect ratio different from mine the canvas looks pretty much the same, but the pointer is offset, so to click a button I need to keep my mouse cursor slightly to the right or left or above it or whatever.
It works fine if the game resolution is the same as the OS screen resolution, or if I run the game windowed.
I've tried using the canvas scaler, aspect ratio fitter and tried anchoring the buttons correctly, but the result is still the same. I've also tried starting a new project with just a canvas and two buttons or even changing the canvas render mode and the camera projection, but to no avail.
Am I doing something wrong?
Hello,
I got the same problem. Did you find a way to solve it ?
Edit: I just find this post: http://issuetracker.unity3d.com/issues/button-position-is-wrong-on-fullscreen-player-which-aspect-ratio-is-different-then-monitors
Does that means it's a real issues or can it be only a problem which can be solve by users ? Anyway, if it's a real issues, vote for it please !
Seems to be an issue with Unity, I never found a fix for it
Answer by FredEspo · Aug 01, 2015 at 07:30 PM
On your Canvas Scaler component, is the "Screen Match Mode" set to "Match Width Or Height"? And is the "Match" set to "0.5"?
The Ui Scale $$anonymous$$ode is set to World because the Canvas Render $$anonymous$$ode is also set to World Space, but even if you set it to Screen Space and $$anonymous$$atch Width or Height or anything else (believe me I've tried them all) it still won't work with different aspect ratios. I believe it is an issue with Unity and needs to be fixed
Your answer
Follow this Question
Related Questions
Tutorials for 2D game GUI 2 Answers
UI Buttons Not Working On Other Camera? 0 Answers
How can you use an object as a button 0 Answers
Canvas buttons too slow 0 Answers
How do Pointer events work? 4.6 UI 1 Answer