Hi! it´s is possible to avoid blurrying of scaled images in HTML5 canvas. I added some CSS to the CerberusGame.html, that works, but it´s much nicer to set this in the cerberus code. I only use mojo1 graphics (drawImageRect). Any advice? thanks.
@axgs I will look at a solution to do this from cerberus code at the weekend. There is a flag called #MOJO_IMAGE_FILTERING_ENABLED and that might be the right one, but for now it doesn't work with the html5 target. So far I know that you have to use multiple settings to make most of the browsers disable linear filtering on the canvas. Something like:
@Wingnut I think you mixed things up with the flag for image loading. Mojo1 doesn't support flags for mipmaps and linear filtering like mojo2 does. And the correct flag for mojo2 images is 0, if you want nearest filtering for the pixelated look.
@axgs Here is a changed file to test, if it works for you. It now sets the filter argument for the canvas.graphicscontext before rendering a frame.
Just replace the file with the existing one in \cerberus\modules\mojo\native and don't forget to make a copy of the old file. Just in case ;-)
Edit: Don't forget to set #MOJO_IMAGE_FILTERING_ENABLED=False to see the pixelated effect!
That's interesting. I am working on a roguelike which I develop in HTML and am always amazed how much better the graphics look when I do a desktop build.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.