uGUI, Scale the buttons with the resolution?

Let’s say i have different resolutions. How do i scale the buttons to fit the different resolutions? The example project just shows an example where the buttons keeps their initial size instead of scaling with the resolution. And then the buttons can overlap, or with bigger resolutions, become too small to be readable.

1742590--110124--scalableui.jpg

Found a solution. I need a orthographic GUI cam. Then i set the render mode of the Canvas to world space. Needs a bit fiddling until everything is displayed where it is needed. But now the GUI scales with the resolution.

Works just for same ratio though. When you switch from 4:3 to 16:9 then you need another GUI layout.

You may consider to use the Reference Resolution component. It needs to be added to the canvas.

Thanks Dantus,

Do you know where it resides? The UI menu entries doesn’t show this component.

I can’t check your image yet, but I see the thumbnail. I believe you are looking for Component → Layout.

2 Likes

Ah, there it hides. Cool. Many thanks :slight_smile:

It is in the scaler currently,