- Home /
Set generated text size inside layout group
I'm trying to make my own text generation. I use TextGenerator
to create text mesh and then I assign this mesh to the CanvasRenderer
of my game object. The problem is that I can't set the size of my game object, because it's parent has VerticalLayoutGroup
component. I have to attach LayoutElement
to my game object and set it's PreferredWidth
and PreferredHeight
to set the size. As I know, Unity's Text
somehow sets it's size inside LayoutGroup
without LayoutElement
. How can I achieve the same functionality?
Your answer
Follow this Question
Related Questions
3D Text Size Relative To Screen? 4 Answers
How to make UI Panel scale to fit content 2 Answers
uGUI Text not updated until RectTransform has been altered 1 Answer
3D layout group 0 Answers
Adjusting the transform width to match wrapped text (TextMeshPro) 0 Answers