SpriteFont issue

Post » Fri Jun 16, 2017 4:44 pm

The C3 spritefont's default character set has two backslashes. This is different from C2, and I can't find a good reason for it. Using a single backslash seems to work fine (on Windows & Mac) for both the character set and the Text value. Two backslashes do seem to escape to a single one, but if the single one works anyway, this is really confusing. Unless there is some different issue on Linux (which I can't test), I don't see the need for it.
ImageImageImage
B
72
S
22
G
288
Posts: 3,862
Reputation: 158,460

Post » Thu Jun 22, 2017 2:12 pm

@Ashley
bump
ImageImageImage
B
72
S
22
G
288
Posts: 3,862
Reputation: 158,460

Post » Thu Jun 22, 2017 3:34 pm

IIRC, this is intentional. C2 had some weird inconsistencies about special characters like newlines in properties. C3 now uses \n for a newline, which means backslashes in general have to be escaped as \\.
Scirra Founder
B
414
S
245
G
92
Posts: 25,207
Reputation: 200,355

Post » Fri Jun 23, 2017 5:31 pm

Ok, that's good. However, it is inconsistent now with setting the text in an action. If I have "One\nTwo\tThree" in the properties, I get newlines and tabs working. If I set this via "Set text", I get: One\nTwo\tThree

Should I log this as a bug?
ImageImageImage
B
72
S
22
G
288
Posts: 3,862
Reputation: 158,460


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests