2D Toolkit Forum

2D Toolkit => Support => Topic started by: mitralone on July 29, 2014, 05:22:13 pm

Title: Feature Request : Autosize TextMesh
Post by: mitralone on July 29, 2014, 05:22:13 pm
Hello,

I am not sure if this is the right place but I will write anyway.

I would like to be able to set the width of a text mesh and then have it autoresize according to content. This would work like the word wrap feature. Most of the time, my text for alternative languages get out of the button borders so this is very much needed. I searched both the code and the interface for something similar but could not find any. I have my own custom code for this but having this as an original feature of 2D Toolkit would be nice.

Mitralone
Title: Re: Feature Request : Autosize TextMesh
Post by: unikronsoftware on July 30, 2014, 12:45:11 pm
Hi,

I've considered this a few times, unsure if it should go into the textmesh itself or a layout type thing - the textmesh doesn't know its bounds... I'll think about it again, thanks for the suggestion.
Title: Re: Feature Request : Autosize TextMesh
Post by: mitralone on July 31, 2014, 05:25:27 am
Hi,

Like I said, the word wrap feature works perfectly. I am using GetEstimatedMeshBoundsForString to roughly estimate the bounds of the text I am about to put in and from there rescaling to the size I again estimate from the word wrap bounds.

Thanks for considering