pyre Posted May 10, 2016 Share Posted May 10, 2016 Hi guys, I'm making a pixel-art game so I don't want anti-aliasing on. Here's my code for toggling fullscreen when F11 is pressed: private toggleFS(): boolean { if (this.game_.scale.isFullScreen) { this.game_.scale.stopFullScreen(); this.game_.stage.smoothed = false; } else { this.game_.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT; this.game_.scale.startFullScreen(false); this.game_.stage.smoothed = false; } return true; } The fullscreen functionality works perfectly, except when I escape from fullscreen it sometimes turns on anti-aliasing. this.game_.stage.smoothed = false; doesn't seem to do anything at this point in the code. Does anyone have any suggestions? Thanks Link to comment Share on other sites More sharing options...
in mono Posted May 10, 2016 Share Posted May 10, 2016 Try this: this.game.antialias = false; Link to comment Share on other sites More sharing options...
pyre Posted May 10, 2016 Author Share Posted May 10, 2016 4 hours ago, in mono said: Try this: this.game.antialias = false; Thanks for the reply! I tried setting that after switching fullscreen, and putting it in my game state's preload function. No luck, unfortunately :-( Link to comment Share on other sites More sharing options...
drhayes Posted May 10, 2016 Share Posted May 10, 2016 Are you in WebGL? The black art of WebGL pixel art! Do you have a CSS rule on your canvas that says "image-rendering: pixelated;"? Link to comment Share on other sites More sharing options...
pyre Posted May 11, 2016 Author Share Posted May 11, 2016 12 hours ago, drhayes said: Are you in WebGL? The black art of WebGL pixel art! Do you have a CSS rule on your canvas that says "image-rendering: pixelated;"? I explicitly set the mode to CANVAS (I'm just setting individual pixels on low-quality textures so didn't really require it, processing power is where I need to optimise ) I didn't have that rule - I added it to my Canvas CSS, unfortunately that made no difference. Thanks for the reply! Link to comment Share on other sites More sharing options...
Recommended Posts