Hi,
I use ORK text codes in the inventory description.
However, part of my UI is using the Unity UI system (get ORK data by script and fill them into the Unity UI).
Is there any way to convert ORK text codes to work in Unity Text?
  • There's the TextHelper class for that, e.g.:
    TextHelper.ReplaceSpecials(ref text);
    Will replace text codes in the used text.

    However, text code replacement doesn't replace icon or formatting text codes, as they're later processed when actually calculating the text positions.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The TextHelper.ReplaceSpecials do nothing to my strings, the text codes such as #text.color are still in the string.
    Here is what I do:
    string des = selectedItem.GetDescription();
    TextHelper.ReplaceSpecials(ref des);
    inventoryDescriptionText.text = des;
  • As said, icon and formatting text codes (like color) are not removed by them, as they're later removed when processing the text positions, and there's no easy way (like a function) you can call to remove them. You'd have to do that manually by replacing them in your text one by one.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.