FlxText formatparse

Sometimes you want to specially format different parts of the text, but you'd like to be able to do it like this with minimal markup:

    t.text = "Show *bold text* between asterisks"
    
    var bold = new FlxTextFormat(true);
    t.formatParse([bold],["*"]);

This would result in:

> "Show **bold text** between dollar signs"

This could be especially useful for when you have to store lots of text in a database-like structure (ie, localization) and you want the person inputting your text to have some basic control over the formatting without having to worry about the programming side of things. The programmer defines a few formatting characters and suddenly everything's very easy to format.

The new formatParse() function for FlxText does just this. You pass in two arrays - a list of FlxTextFormats, and a list of corresponding marker strings. It parses the text property of the FlxText, removes the marker strings, and then applies the formats in the correct ranges.

It also handles nested formatting and multiple uses of the same format (I added a clone() method to FlxTextFormat to aid this)