Jump to content

Switch off graphics antialiasing


8bitdna
 Share

Recommended Posts

Hi All,

Does anyone know how to switch off antialiasing when drawings lines and circles etc?

For example with the following code..

game.module(
    'game.main'
)
.body(function() {

game.createScene('Main', {
    init: function() {
        var grap = new game.Graphics();
        grap.drawCircle(50, 50, 50);
        grap.addTo(this.stage);
    }
});

});

...and config...

game.config = {
    name: '',

    system: {
        width: 100,
        height: 100,
        scale: true,
        center: true,
        resize: false
    },
    
    renderer: {
        scaleMode: 'nearest'
    },

    mobile: {
    }
};

...you'll see the circle with anti aliasing etc, can I switch it off, handy for low res stuff?  Thanks all!

Link to comment
Share on other sites

Thanks @enpu

Been looking at a few posts on Stackoverlfow etc and seeing quite a few folks with the same problem like this..

https://stackoverflow.com/questions/195262/can-i-turn-off-antialiasing-on-an-html-canvas-element

Looks browser controlled and at best hacky to workaround.  I really want it for some lines so I'm thinking a 1px x 1px sprite stretched and rotated using nearest filtering will do the trick.  Cheers.

Link to comment
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...
 Share

  • Recently Browsing   0 members

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