Sprites not scaled properly

N

NewbieMaker483

Guest
Hello everyone!

I'm making an android game and on some very small screen sizes, the sprites appear just way to big. Is there a way to properly scale each sprite to make them look about the same size on different screen sizes?
 
C

Crispywrists

Guest
I'm not totally sure here, but could you find the ratio you want the object to be in comparison to the screen size and use that?

That's probably not very well explained, but something along the lines of:

image_xscale = room_height/700;
image_yscale = room_width/700 ;

So it would always be the height and width of the screen divided by 700? That's just an arbitrary number and this may not work at all, but then again it might work. Who knows!

Aha sorry, not very helpful but hey ho, something to try before the wizards come in and tell you the real way to do it.

Good luck!
 

kamiyasi

Member
You probably shouldn't be scaling any sprites to get the result you want. I would set the room's viewport to something close to a mobile screen standard like 1920x1080, and draw the application surface stretched to your display size, something like this...
Code:
surface_resize(application_surface,view_wport[0],view_hport[0]);
display_set_gui_size(view_wport[0],view_hport[0]);
window_set_size(view_wport[0],view_hport[0]);
 
N

NewbieMaker483

Guest
Thank you very much, both of you, for replying but unfortunately,it didn't help.
This is the creation code of both of my game rooms:

view_hview[0] = display_get_height();
view_wview[0] = display_get_width();


view_hport[0] = display_get_height();
view_wport[0] = display_get_width();


room_width=display_get_width();
room_height=display_get_height();


surface_resize(application_surface, view_wview[0], view_hview[0]);
display_set_gui_size(view_wport[0],view_hport[0]);
window_set_size(view_wport[0],view_hport[0]);

does this help?
 
H

Hugh Patrick Greene

Guest
I had a similar problem with scaling on my game. when i went full-screen on the windows platform, certain characters would be out of place. i researched on youtube and found out what my problem was and corrected it. I've did some research for you and found a video which i think may be useful.

 
H

Hugh Patrick Greene

Guest
I did some research and I found another video (or rather series of videos) which may be of even more use to you.


The author explains in detail about scaling, resolution and zooming when developing games. There are actually 4 videos in the series and I advise watching all of them. hope this helps you and others.
 
Top