- Home /
Question by
Samrp · Apr 23, 2016 at 10:48 AM ·
canvasscaleaspect-ratioscreen resolutionscreen size
How to make my UI items/canvas stretch to fill preset aspect ratio
I have created a game in which the camera aspect stretches the view to fit a 16:9 aspect ratio but my UI elements don't stretch![alt text][1] like the other objects so the image is cut of at the top.
The UI should look like this:
However it is cut of on other resolutions:
The Code for the camera aspect:
void Start () {
Camera.main.aspect = 9f / 16f;
}
// Update is called once per frame
void Update () {
}
and the settings for my canvas are: Scale with screen - expand reference resolution: x = 1136 y = 640
Please help soon!
screen-shot-2016-04-22-at-222800.png
(47.9 kB)
screen-shot-2016-04-22-at-222813.png
(51.7 kB)
Comment