T
T
Taranas2021-05-03 21:16:11
Unity
Taranas, 2021-05-03 21:16:11

How to adjust the size of an object depending on the text in it?

It is necessary to change the size of an object (button, etc.) depending on the text that is located in it. If the amount of text increases, then the object must stretch to fit the text.
I came across this article https://docs.unity3d.com/ru/2019.4/Manual/HOWTO-UI... but I don't understand why it doesn't work.
When changing the Horizontal/Vertical Fit, the object is flattened to 0. Why is that?
I tried to add Layout Elements to the same object and set values ​​in it, but after that, if you change the Horizontal / Vertical Fit, the object simply takes the set values ​​​​and does not respond to text changes.
Help me please)

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