html screen scale no work fine

jo-thijs

Member
Could you provide us with reproducable code.
What code with what room settings gives a pixelated effect?
 
Y

yackson cc

Guest
I make a demo for you check my problem.

https://www.dropbox.com/s/1n69u7glgjt7y2u/aspecRactio.gmz?dl=0

the room named "roomTest2" have the problem mentioned above.
the room named "roomTest" work perfectly and not have pixel.

the pixel elements of screen apears when I scale view_wview or view_hview or surface_size application, or ports view.

I was search help in some webs and find this:

http://truevalhalla.com/blog/buy-html5-games

All games in this web work perfectly in movile device and not have pixelated elements, how make this?,

thanks!

thanks!
 

jo-thijs

Member
There's nothing wrong with how you manage your views (except that resizing needs to happen when the browser resizes).
The problem is, your drawing your sprites scaled down.

With your view dimensions, port dimensions, application surface dimensions perfectly in sync,
it means something is being drawn smaller than it can actually be drawn.

Some pixels will be lost in this process.

The reason you don't notice this as much on the windows target is because in "global game settings" > "Windows" > "Graphics", the option "Interpolate colors between pixels" is checked,
while it isn't checked in "global game settings" > "HTML5" > "Gaphics".

The solution is to either check this option there or to resize the port and application surface based on the window dimensions, rather than the view dimensions.
 
Top