Yangrui
Yangrui

Reputation: 1247

How to line-break buttons using Unity 3D New UI

I'm not familiar with Unity's new UI system of 4.6 and later. I would like to display a series of buttons on screen and have them center-aligned and breaks into the next line when screen width is reached. The old OnGUI function no longer seem working so I wonder how can I achieve this?

Upvotes: 0

Views: 1121

Answers (1)

Max Yankov
Max Yankov

Reputation: 13287

You need to use UI's layout system. Usually, you just create a Layout Group and populate it with objects that have Layout Element component.

Upvotes: 3

Related Questions