Author Topic: How to work around [00] alpha encoding in labels?  (Read 2099 times)

sintua

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 0
  • Posts: 63
    • View Profile
How to work around [00] alpha encoding in labels?
« on: January 26, 2015, 05:12:18 PM »
I use encoding to change colours of the text in a string, but I also need to include [10] and etc in the label, which turns the thing transparent. I can't even escape the encoding with a [[10], and I can't disable encoding because I use it for colour.
Is there an escape character so prevent the label from taking any [##] string and changing it to an alpha? the [any6characters] limitation was mildly obnoxious, but not being able to put 2 characters in brackets is causing problems all throughout my game, not even just this label.

Is there not an escape character for when we actually just want to type a bracket without invoking the encoding?


Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: How to work around [00] alpha encoding in labels?
« Reply #1 on: January 26, 2015, 06:56:13 PM »
As far as I know, there isn't one right now, but it doesn't sound like a crazy addition. If you want to quick fix it, you can look into the NGUIText class where the string gets processed and add an escape for now.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to work around [00] alpha encoding in labels?
« Reply #2 on: January 27, 2015, 04:26:00 AM »
Just break up the sequence. For example, one of these:
  1. [c][[/c]01]
  1. [[-]01]

sintua

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 0
  • Posts: 63
    • View Profile
Re: How to work around [00] alpha encoding in labels?
« Reply #3 on: January 27, 2015, 11:43:22 AM »
Ah, thank you! That should work well! But I would recommend adding the "[[" escape character, it seems to be typical usage in other similar situations, would resolve this kinda problem in a simpler more expected manner :)