Skip to content

Commit

Permalink
FlxBitmapFont: remove background of XNA fonts (#2187)
Browse files Browse the repository at this point in the history
Performing bmd.threshold() with bgColor32 is necessary to prevent the background color from appearing between letters when a FlxBitmapText using this font is scaled by a non-integer value
  • Loading branch information
Birdwards authored and Gama11 committed Nov 19, 2018
1 parent 06ec2b2 commit 4e2c026
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions flixel/graphics/frames/FlxBitmapFont.hx
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,8 @@ class FlxBitmapFont extends FlxFramesCollection
var frameRect = flashRect;
frame.frame.copyToFlash(frameRect);

#if flash
// TODO: fix this issue...
// for some reason this line causes app crash on targets other than flash...
var bgColor32:Int = bmd.getPixel32(Std.int(frame.frame.x), Std.int(frame.frame.y));
bmd.threshold(bmd, frameRect, point, "==", bgColor32, FlxColor.TRANSPARENT, FlxColor.WHITE, true);
#end

if (charBGColor != FlxColor.TRANSPARENT)
{
Expand Down Expand Up @@ -658,4 +654,4 @@ class FlxBitmapFont extends FlxFramesCollection
font.updateSourceHeight();
return font;
}
}
}

0 comments on commit 4e2c026

Please sign in to comment.