• 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!

moving from a room to another and porting corrupt the quality

A

AliBahrami

Guest
I have two rooms with different sizes:
rm_menu : 240 * 400
rm_game: 2000* 2000
there are no views in the rm_menu, but we have one view in rm_game.
view[0] has:
view_xview[0] = 0
view_yview[0] = 0
view_wview[0] = 320
view_hview[0] = 240

view_xport[0] = 0
view_yport0] = 0
view_wport0] = 320
view_hport0] = 240
with no code, size of screen remains 240 * 400 even in rm_game. I added window_set_size(320, 240) in room creation code in rm_game and size seems ok but the quality of sprites drop-off dramatically.
any solution to redraw the sprites? or solve the quality problem?
I search the web but nothing there
 
F

frumple

Guest
You could try to make the first room the size you want your game to be, 2000x2000 in this case, then go to the menu room. it will be stretched and probably badly but you could fix that by using sizes that have the same aspect ratio. Alternatively, you could manualy draw to a surface and then stretch that surface yourself, but that could get very messy.

Read up the manual entry for the application surface. I think that is where your problem lies, and the solution *could* be simply resizing the thing. Changing the window size is probably not enough.
 
A

AliBahrami

Guest
I read the manual, find this code:
if view_wport[0] != surface_get_width(application_surface) || view_hport[0] != surface_get_height(application_surface)
{
surface_resize(application_surface, view_wport[0],view_hport[0]);
}
added to code and worked perfectly!
Thanks!
P.S: The full code is :
view_xview[0] = 0
view_yview[0] = 0

view_wview[0] = 320
view_hview[0] = 240

view_xport[0] = 0
view_yport[0] = 0

view_wport[0] = 320
view_hport[0] = 240

window_set_size(320, 240)

if view_wport[0] != surface_get_width(application_surface) || view_hport[0] != surface_get_height(application_surface)
{
surface_resize(application_surface, view_wport[0],view_hport[0]);
}

room_goto(rm_game)
 
Top