Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

I do my web browser games from scratch using raw javascript, so I don't know if this will be any help.  What I learned was I had to control two elements of the canvas.

The first part was with css.  This is placed in my index page:

  • canvas,body{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;}

And then with javascript, you have to make sure this is kept because anytime a canvas element is changed (new size, sometimes clearing it, etc., it will auto default to the blurry style again.

  • const D=(a)=>{return document.getElementById(a)} }let k=D(x),i="mageSmoothingEnabled";k.width=a,k.height=b;let ctx=D(x).getContext("2d");window['ctx.i'+i]=false;window['ctx.mozI'+i]=false;window['ctx.msI'+i]=false;window['ctx.webkitI'+i]=false

Maybe you can find some equivalent in Godot or this can help point you in the right direction?  I cannot say.  I have never looked into Godot.