[SOLVED] Odd problem with "[" character

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
chaosavy
Just popping in
Just popping in
Posts: 10
Joined: Tue Dec 28, 2010 19:39

[SOLVED] Odd problem with "[" character

Postby chaosavy » Thu Aug 04, 2011 01:24

So in my project I have a tutorial that goes through key commands, one of them is basically this text "Press the [ key." but what gets pout in the text gui is this: "Press the Press the [ key." Its bizzare but the "[" character causes this duplication (if I change it to any other character it works fine). Any info? This is set from a text file, so its kind of bugging me. Worst case scenario I'll type it out.. press the left bracket key (but when I put in keymapping this will get all fudged up as well).

thanks for any info
Last edited by chaosavy on Mon Aug 08, 2011 16:25, edited 1 time in total.
Check out my space sim http://www.arrmaytey.com

ShadowTiger
Quite a regular
Quite a regular
Posts: 46
Joined: Fri Mar 19, 2010 05:31

Re: Odd problem with "[" character

Postby ShadowTiger » Thu Aug 04, 2011 01:34

have you tried putting a backslash in front of the bracket to escape it? My guess is that theres some regex or similar going on.

"Press the \[ key"

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Odd problem with "[" character

Postby Kulik » Thu Aug 04, 2011 10:41

There are 2 solutions to this, it's caused by the fact that [ is a special formatting character.

Either setTextParsing(false) or escaping. You only have to escape the starting [ character with a backslash as ShadowTiger said.

User avatar
chaosavy
Just popping in
Just popping in
Posts: 10
Joined: Tue Dec 28, 2010 19:39

[SOLVED] Re: Odd problem with "[" character

Postby chaosavy » Sun Aug 07, 2011 15:29

Awesome thanks! I disabled the parsing and that did it.
Check out my space sim http://www.arrmaytey.com


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests