pyre

Escaping fullscreen turns on anti-aliasing

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

Share this post


Link to post
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 :-(

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.