To get Haxeflixel to maintain 1:1 pixel rendering at any scale for desktop targets:
In your Project.xml
, add a new window property with an desktop conditional, resizable
set to false, and the desired width
/height
to match the resolution you'd like to maintain.
<window if="desktop" resizable="false" width="320" height="180" />
Apply a shader to the FlxGame instance or the main FlxCamera instance as a filter. The base FlxShader can even just be used if the project doesn't require custom shaders.
FlxG.game.setFilters([new ShaderFilter(new FlxShader())]);
This is enough to make the game render at the correct resolution, but the game's image will be blurry thanks to Openfl's image smoothing. This can be turn off by setting the stage quality to LOW.
FlxG.game.stage.quality = StageQuality.LOW;
From this point the game can have its window resized/switched to fullscreen like so:
// Sets the window size to 960x540
FlxG.resizeWindow(960, 540);
// Sets the window to fullscreen
FlxG.fullscreen = true;
An example of this technique can be found here.
doesn't seem to work anymore :(