Jump to content

Subpixel render / pixelart scaling


veggis
 Share

Recommended Posts

So i've encountered a problem when it comes to rendering low res sprites and upscaling in phaser. I'm pretty sure this issue has been tackled many times, but i haven't found any good solutions to it.

The problem is that some pixels are getting wider than others. Like this:

Skjermbilde.PNG

My game is at 480x320 and im scaling the game with SHOW_ALL.

I've tried settin roundPixels to true and various CSS tricks. But nothing seem to change.

Anybody know a swift solution to this?

 

Thanks!

Link to comment
Share on other sites

I've encountered this a few times (Not just using canvas), but scaling either a little larger/smaller to something a bit more round usually solved the problem. Maybe that's the issue?

Hope it helped.

Link to comment
Share on other sites

Thanks for the reply!

@BlitZ - I've experimented with different sizes, but it didn't seem to change anything. I also tried to make sure that the canvas width and height can't be an odd number to make sure aspect and pixels per row are allways the same. (since 480x320 %2 == 0)

@samme - The game gets scaled. In other words the canvas and everything with it. I could do it the other way around, but that seem like unnecessary work.

@douglas - I can't quite see the relevance. Are you saying i have to create sprites from a tileset?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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