N
N
nano_e_t_42020-05-04 19:12:05
Unity
nano_e_t_4, 2020-05-04 19:12:05

How to dynamically resize UI?

Hello everyone
, I'm making a dialog system, and the following problem arose:
there is a ui that displays dialog options \ phrases - nodes. I display these nodes through the grid layout group. The UI has an arrow. the player can move this arrow and depending on its position this or that text will be displayed (and this or that choice will be made)

the question is how to make this UI change its size depending on the number of nodes that should be displayed on the screen

I don’t want to make crutches like look at the number of nodes displayed, then, based on this number, set the size of the UI, place elements sequentially there, etc. - in general, write tons of codes. Is there any standard way to do this? (for example, the Best Fit property of the text, with the help of which unity itself determines the desired text size on a limited

5eb03eb24afa1794545747.png

5eb03e50d167b953954874.png
UI , depending on the number of characters)
with which the player will choose dialogue options?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question