- Home /
Adjusting the transform width to match wrapped text (TextMeshPro)
I've got a parent container with a Horizontal Layout Group component, with an image and TextMeshPro text box as its children. When I enter enough text into the text box the wrapping kicks in, increasing the height of the text box and pushing some words onto the next line, as expected.
What I would like is for the image and the text to remain side by side without the gap introduced by the text wrapping between them, however I can only seem to achieve this by manually inserting a line break into the text like so:
Is there any way to have the text box shrink its width to match its content once the wrapping has taken place? Perhaps something along the lines of use an initial width to decide how to wrap, then replace that width with the new width of the actual text geometry post-wrapping?
Your answer
Follow this Question
Related Questions
Wrap text textmesh 0 Answers
Wrapping a Textmesh text 5 Answers
How to calculate a TextMesh width without rendering it ? 2 Answers
RegisterDirtyLayoutCallback not working inside a vertical layout group 0 Answers