Is there a way to get the text to constrain itself to a custom polygon instead of a rectangle. It would be great not to have to use a rectanglular paragraph inside a of round speech bubble.
Text for Unity, Super-Powered! · By
Hey!
This is a good idea, but not directly supported, and I'm not too sure how I would support it... It'd have to be a big update.
But, for the time being, I do have an indirect solution that already works!
Super Text Mesh has a "Pagination" feature, where text from one text box can be set up to automatically overflow into another. So... using this, you can set up multiple single-row Super Text Mesh objects that fill your round speech bubble, then just send the updated text to the first STM in the chain and... bam! Multiple STM objects can work as one.
If you have a static text box that will never change size, this won't take long at all to set up. If you have one that changes size dynamically... this might take a bit longer to set up, but it is possible. You'd have to systemically instantiate STM objects, and assign their position and autoWrap values based on the evaluation of the polygon at a given Y coordinate. If you need help coding this for a circle/oval, I can try to whip up some sample code, but for more complex geometrical shapes, I might have to do a bit more studying...
Hey!
I forgot to mention last time, I have a script included in the sample folder named "STMPagination" that can be used to do this, or used as an example. Here's an updated version (with delegate events instead of requiring UnityEvents) so you don't have to dig through my code: https://pastebin.com/g46WEWvn
I hope this helps!
To clarify, are you enabling the text gameObject or text component? There's a biiit of code that'll be changing in the next update that should finally make the two work exactly the same, but...
In some situations, when enabled, Super Text Mesh will actually take one extra frame to recalculate. It's an old fix to get around a problem with async loading. Using a manual Rebuild upon enable is probably the best option here. (You can disable auto-rebuild in the inspector to prevent it from rebuilding twice!)
Hopefully that works... if there's any further issues I'll take a deeper dive into this!