How to turn off anti-aliasing on fonts?

866 views
Skip to first unread message

E. Zachary Knight

unread,
Jul 25, 2014, 4:09:37 PM7/25/14
to haxef...@googlegroups.com


Is it possible at all to turn off anti-aliasing on fonts? 

I ask because I am getting ready to take part in the GameBoy Jam and they only allow 4 colors and HaxeFlixel fonts are anti-aliased which creates too many colors.

I could get around this by not making a font heavy game and only using graphics for the text I do have, but that kind of limits my ideas before making the game.

Gama11

unread,
Jul 25, 2014, 4:23:38 PM7/25/14
to haxef...@googlegroups.com
FlxText uses a flash Textfield, and there might not be a way to disable its antialiasing. If you want to try though, it is exposed through FlxText#textField.

Your best bet are probably bitmap fonts / FlxBitmapTextField.

E. Zachary Knight

unread,
Jul 25, 2014, 4:57:33 PM7/25/14
to haxef...@googlegroups.com
Yeah, it looks like I may have to go with FlxBitmapTextField. I haven't used that so I will have to play with it. 

Looking at the AS3 API documentation for TextField, the only options are anti-aliasing and more anti-aliasing. How convenient.


Gama11

unread,
Jul 25, 2014, 5:03:02 PM7/25/14
to haxef...@googlegroups.com
Another option might be to go with pixel fonts like the flixel default font at "correct" font sizes (usually powers of 8). You'll notice that only white pixels are used in this example:

add(new FlxText(0, 0, 0, "Hello World"));
Reply all
Reply to author
Forward
0 new messages