Search code examples
haxehaxeflixel

Disable antialiasing for specific sprites


How can I disable anti-aliasing for particular sprites in HaxeFlixel?

To be specific, I need to disable anti-aliasing for some FlxTexts, because I'm using a font that is very pixellated on purpose and looks much better that way.

I've tried .textField.antiAliasType, but that doesn't seem to have a 'disable' possibility. Nothing else looks related to anti-aliasing.


Solution

  • Flash doesn't have an option to "disable" antialiasing on text. You only have control over this property if the font is embedded (but you still can't disable it).

    If NORMAL and ADVANCED don't work for you, the alternative is to make your font a bitmap font and use flixel's bitmap text and font classes to handle it. Flixel has helper functions for Pixelizer- and AngelCode-generated bitmap fonts here.