Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

[solved] is Soft Hyphen supported?

A topic by miksol created Jan 05, 2019 Views: 986 Replies: 3
Viewing posts 1 to 4
(1 edit)

Hi!  Before buying, I want to know whether text wrapping is supported by the following characters:  Soft Hyphen (U+00AD) or Hair Space (U+200A) or Zero Width Space (U+200B)

Thank you!

Developer

Hey!


Automatic text wrapping characters are actually something I've been meaning to revisit for a while, so they can be completely customizable.

Right now, stm is programmed just to autowrap at spaces, hyphens, and tabs, but its just a few lines of code that controls this, so the additional characters can be added that way until I redo that system to be easier to edit.


The lines that wpuld need to be added to are lines 1806, 2889, and 2938. Those just have if statements that look for the specific characters. (This really does need to be redone)


The slighty trickier part is around line 2392. There, variables are created to check the positions of linebreak-ready characters, and then on line 2392, all those variables are compared and a linebreak gets inserted at the largest one.


If ypu need additional help, email me through my website with your invoice no. after purchasing, and I'll send you a modified version of STM with these changes. Once again, I hope to make this system more dynamic in the future.

Thank much for the answer!  It's good that there is an opportunity to easily add additional  characters for autowrap.

Developer

Hey!


Just letting you know, I finally changed up how this works for v1.8.15, which I just submitted to the asset store, and just published on itch! 

I added a private "linebreakFriendlyChars" array in SuperTextMesh.cs that can be edited to support more characters! I've added the ones you've mentioned as defaults. It's a private variable right now, so you'll have to edit the source code to add more characters, but it gets the job done!