Also, look at your canvas’s render mode. And your elements alignment. If any are set to stretch, then you will get what you call deformities. That is by design.
Oh! I get it. no I don’t use that type of configuration most of my GUI is hooked to the center with a certain size.
I should explain myself better, my GUI works well, it adapts to cell phone screens.
The problem arises specifically when I use
I put the circles in the corners so that the deformations are more noticeable.
1)This is the canvas configuration.
2) It is the configuration of an UI element.
3) It is an image of a cell phone with resolution 2340 x 1080
As you can see, although the configuration was 1920 x 1080, it adapts well.
4) Now after running the code:
float xx = Screen.width;
float yy = Screen.height;
Screen.SetResolution(1280, 720, true);
camara.aspect = xx / yy;
Hmmm… I see, yea that’s nothing related to what I mentioned.
Sorry, I have not played much with different resolutions before. My guess atm though would be your canvas settings.
If you switch match mode from width => height, to height => width. Do you screen deform the other direction?
You could try changing the canvas reference resolution to match your screen. However my understanding is that you should not have to, match mode takes care of that. Worth a try though.
So I just created a project to test it myself. Canvas and image settings are the same as yours.
Using the below code worked just fine. No issues. This was tested on version 2019.3.11f1
Have you tried making a new project and redoing the UI to see if it was a bug? Maybe try a different version too.
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
float xx = Screen.width;
float yy = Screen.height;
Screen.SetResolution(33440, 1440, true);
Camera.main.aspect = xx / yy;
}
if (Input.GetKeyDown(KeyCode.DownArrow))
{
float xx = Screen.width;
float yy = Screen.height;
Screen.SetResolution(900, 900, true);
Camera.main.aspect = xx / yy;
}
}