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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.