• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Blurry sprites question

Toque

Member
So I make sprites 32X32.

Place them in a room 683 by 384.

Then I double the size of the window. window_set_size (1366, 768);
Run the build.

The sprite is blurry.


But if I export same sprite from pyxel edit and double its size to 64 X64.
Then shrink the sprite image_xscale =.5 image_yscale = .5 in player object.
Looks great.


My old brain doesn't understand why that should be? Interpolation is off.
 

Toque

Member
Have you tried resizing the application surface to the size of the window?
Sorry I have not done that or would know how to do that. I found a solution and probably just be content with it. I was just curious because in my mind I was doing the same thing.

But thank you.
 
surface_resize(application_surface, 1366, 768 ); is how you would do it. There's a blog series on yoyogames blog somewhere that goes into detail about resizing the game window and the different things you should do if you want to learn more about it =)
 

Pixel-Team

Master of Pixel-Fu
I usually do these to make sure there's uniform scaling of pixels.
GML:
display_set_gui_size(426 240);
window_set_size(426, 240);
surface_resize(application_surface, 426, 240);
You also want to look at the Sprite itself and make sure on its Texture Settings, you have edge filtering deselected. Having Edge Filtering will try to smooth the sprite when scaled, instead of giving you clean, squared off pixels.
 

Toque

Member
I usually do these to make sure there's uniform scaling of pixels.
GML:
display_set_gui_size(426 240);
window_set_size(426, 240);
surface_resize(application_surface, 426, 240);
You also want to look at the Sprite itself and make sure on its Texture Settings, you have edge filtering deselected. Having Edge Filtering will try to smooth the sprite when scaled, instead of giving you clean, squared off pixels.
Hmm. So playing with it today. I think its the sprite itself. If I add sprites from other jam games I did they look fine.

Resizing the application surface doesn't change the sprite blurry. "edge filtering" is off as default.

Your a great pixel guy. I will continue with your advice.
Thanks again
 

Toque

Member
surface_resize(application_surface, 1366, 768 ); is how you would do it. There's a blog series on yoyogames blog somewhere that goes into detail about resizing the game window and the different things you should do if you want to learn more about it =)
Thank you. I can read the manual with that help now.
 

TheouAegis

Member
Unless it's changed, the size of the WINDOW is not the size of the application_surface. So even though you scale the size of the window by 2.00000, the application_surface might only scale up by 1.91825, which would cause blurring.
 
Top