Hi,
I have an Android portrait app, which is designed to “stretch” the canvas to the full screen, scaling everything with it. Even if it becomes a little distorted and out of aspect.
To do this I have an Orthagraphc Camera and the Render Mode of my Canvas is World Space.
I then have this code attached to the Canvas:
Vector3 screenSize = Camera.main.ViewportToWorldPoint(Vector3.up + Vector3.right);
screenSize *= 02;
float sizeY = screenSize.y / rt.rect.height;
float sizeX = screenSize.x / rt.rect.width;
rt.localScale = new Vector3(sizeX, sizeY, 1);```
This has been working fine for the past 18 months or so...
I now want to release my apps on IOS, and need to make everything fit to the SafeArea for the iPhone X etc.
Every SafeArea script I have tried does absolutely nothing...
Is there anything I can do with my current set-up to get one of these SafeArea scripts working?
Can I modify my little bit of code above to set the Canvas size to the SafeArea instead of the camera size?
Many thanks for any advice!
MIke.