N
Naoki
Guest
Hello everyone,
I am desperately seeking help to scale my game, I just can't understand this stuff, nothing is working, I constantly have weird results.
I developped a Shoot' em up using 1920*1080 rooms. My computer screen is also 1920*1080. Now I want to scale it to whatever screen the player is using. At this point, I don't care if they have black bars, I just want to be done with this nightmare.
I tried RangerX tutorial but for some unknown reasons it's just not working. Right now I am trying to make it work with a 1366*768 resolution, so I had this code (I asked for help on reddit so I changed a bit the code from the tutorial):
This code is in a specific object alone in a room set at the very beginning of the game.
It's not working for various reasons. First, the collision boxes are not on the sprites anymore. For example, when I am on the main menu I have individual buttons like "Play", "Options" etc. I am supposed to click on them to activate them. It works fine in 1920*1080 but when I scale the game, I have to actually click next to the button a little bit below to click on their collision box.
Now I am completely lost, I don't know what I should do. Am I supposed to change the room size? Change the view or viewport size?
When I test, my GUI is 1366*768, same for my application surface, I tried to change the view, viewport and room size but it's solving nothing, it's just adding new problems like text overlapping on each other.
I thought too much about it, everything is blurry in my mind now.
I am desperately seeking help to scale my game, I just can't understand this stuff, nothing is working, I constantly have weird results.
I developped a Shoot' em up using 1920*1080 rooms. My computer screen is also 1920*1080. Now I want to scale it to whatever screen the player is using. At this point, I don't care if they have black bars, I just want to be done with this nightmare.
I tried RangerX tutorial but for some unknown reasons it's just not working. Right now I am trying to make it work with a 1366*768 resolution, so I had this code (I asked for help on reddit so I changed a bit the code from the tutorial):
Code:
application_surface_draw_enable(false);
window_set_fullscreen(true);
global.MonitorW=display_get_width();
global.MonitorH=display_get_height();
if (global.MonitorW>=1366 && global.MonitorH>=768){
global.view_width = 1366;
aspect_ratio = global.MonitorW / global.MonitorH
global.view_height = global.view_width / aspect_ratio
display_set_gui_size(global.view_width, global.view_height);
surface_resize(application_surface,global.view_width,global.view_height)
global.Xoffset=(global.MonitorW-1366)/2;
global.Yoffset=(global.MonitorH-768)/2;
}
This code is in a specific object alone in a room set at the very beginning of the game.
It's not working for various reasons. First, the collision boxes are not on the sprites anymore. For example, when I am on the main menu I have individual buttons like "Play", "Options" etc. I am supposed to click on them to activate them. It works fine in 1920*1080 but when I scale the game, I have to actually click next to the button a little bit below to click on their collision box.
Now I am completely lost, I don't know what I should do. Am I supposed to change the room size? Change the view or viewport size?
When I test, my GUI is 1366*768, same for my application surface, I tried to change the view, viewport and room size but it's solving nothing, it's just adding new problems like text overlapping on each other.
I thought too much about it, everything is blurry in my mind now.