Jump to content

Escaping fullscreen turns on anti-aliasing


pyre
 Share

Recommended Posts

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

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

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 :angry:)

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...