So at the moment a text element is simply a font, size, colour and text effect (in essence), which is fairly limited on in game gui’s especially for something like a strategy game where you might need to format the text to make sure certain information stands out. We’re looking to overhaul the class to provide in-line formatting similar to bbcode and would like to hear any views on the implementation. So far we’re looking to support the following tags:
[color=#FF40FF][/color] - Color of the text.
[b][/b] - Bold formatting.
[i][/i] - Italic formatting.
[size=16][/size] - Font size. (This is one of the ones we're not sure about, depends on supportability when creating batches [row height being the big question] and feedback).
[shadow=#FF40FF][/shadow] - Shadow with shadow colour (replaces TextEffect).
[stroke=#ff40ff][/stroke] - Stroke with stroke colour (replaces TextEffect).
This would require a change to batch construction where we would parse the text and when finding a’ [’ parse up till the next ‘]’ and check if its a supported tag, if it is until the closing tag is reached the defaults set for that text will be over-ridden or alternatively split the printText vector up into subsets which are parsed during the UpdateText phase and batches are based off the parameters in those subsets.
Since the tags will be effectively ignored and edge cases such as space before and after the tags re-formatted, we believe it should be viable.
If anyone has any suggestions or feedback we’d like to hear them.