Skip to content

Commit

Permalink
FlxTextFormat: add an example of multi-character markers for applyMar…
Browse files Browse the repository at this point in the history
…kup()

see HaxeFlixel/flixel#1908
Removed some odd code in update() - presuambly leftover debugging code.
  • Loading branch information
Gama11 committed Aug 21, 2016
1 parent 1c96c57 commit e218192
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions UserInterface/FlxTextFormat/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using flixel.util.FlxSpriteUtil;

class PlayState extends FlxState
{

public var text1:FlxText;
public var text2:FlxText;

Expand All @@ -34,8 +33,8 @@ class PlayState extends FlxState
add(text1);

text2 = createText(120);
text2.applyMarkup("*Forma*_tted_ $v$^i^!a! apply:Markup():", [
new FlxTextFormatMarkerPair(format1, "*"),
text2.applyMarkup("<y>Forma<y>_tted_ $v$^i^!a! apply:Markup():", [
new FlxTextFormatMarkerPair(format1, "<y>"),
new FlxTextFormatMarkerPair(format2, "_"),
new FlxTextFormatMarkerPair(format3, "$"),
new FlxTextFormatMarkerPair(format4, "^"),
Expand All @@ -44,16 +43,6 @@ class PlayState extends FlxState
add(text2);
}

public override function update(elapsed:Float):Void
{
super.update(elapsed);
if (FlxG.keys.justPressed.ONE)
{
var b = text1.graphic;
add(new FlxSprite(0, 0, b));
}
}

function createText(y:Float, ?text:String)
{
var text = new FlxText(60, y, FlxG.width, text);
Expand Down

0 comments on commit e218192

Please sign in to comment.