Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: athos on November 27, 2012, 11:12:03 PM
-
Anyone having trouble getting an apostrophe to show up inside a label? It's not showing up for me, so I tried escaping with a backslash, but that just gave me a backslash. :-)
-
I updated UILabel.ProcessText as follows and now I can at least get an apostrophe to render by escaping it.
mProcessedText = mText.Replace("\\n", "\n").Replace("\\'", "'");
Would this be useful to include in a future update?
-
Eh? This change makes no sense. An apostrophe is not a special character, and it works perfectly fine as-is. It's only a special character if you are doing this:
-
I'm glad it works for you, but it doesn't work for me. I can type this in for the text of a label:
This user's test.
And it renders as:
This users test.
I added the escape sequence to work around the issue.
-
Look at the menu example that comes with NGUI. The text there reads:
"Since this is merely an example of NGUI's functionality..."
Note the apostrophe. Shows up fine.
-
Very interesting. That scene just rendered correctly for me too, so I tested the label in my test scene again and it still refused to render the apostrophe without the code change. I just grabbed the latest from the asset store as I was a couple releases behind, rebuilt, and now both are rendering fine. I don't what was going on there, but glad it's working now. Thanks!
-
Sounds like the apostrophe was missing from your font, then it just doesn't render.
-
Thanks, I thought that too at first. But, I did check that, and it rendered when I did the escaping trick. I've had some odd problems like this in the past with Unity's build folder getting out of whack, so pulling down the latest and recompiling those scripts must have put things back to a good state.