S
Spencer S
Guest
Everything below works for my screen, including the GUI functions (my screen is 2736x1824).
Room Creation Code:
Just as an FYI, I use the guiAspectScaling to convert into a multiplier called guiScalingVector which is then multiplied against all object positions and sizes. For example, instead of drawing a sprite on the GUI later to (display_get_width() / 2), I draw the sprite to ((display_get_width() / 2) * guiScalingVector), which then correctly puts the drawing in the middle of the screen.
The problem is that when I run my game on any other monitor with a different resolution, the game itself is still drawn fine, but the GUI is drawn incorrectly. Basically, its just the display_set_gui_size() and display_set_gui_maximise() functions that are giving me a problem. I've tried messing with resolution ratios, and I've watched Pixelated Pope's youtube tutorials on cameras, as well as Shaun Spalding, but I can't seem to get it down.
What I need is some way to get the aspect ratio and correctly change the GUI so that everything still draws correctly.
Room Creation Code:
Code:
view_visible[0] = true;
view_enabled = true;
// Variable used to change gui ratio and/or gui aspect ratio. if this is changed, this same variable needs to be changed in the Create event in obj_equipped_inventory_gui as well.
guiAspectScaling = 0.1;
camera = camera_create_view(0, 0, 20480, 15360, 0, obj_player, -1, -1, 10240, 7680);
var viewmat = matrix_build_lookat(640, 240, -10, 640, 240, 0, 0, 1, 0);
var projmat = matrix_build_projection_ortho(640, 480, 1.0, 32000.0);
camera_set_view_mat(camera, viewmat);
camera_set_proj_mat(camera, projmat);
view_set_camera(0, camera);
display_set_gui_size(display_get_width(), display_get_height());
display_set_gui_maximise(guiAspectScaling, guiAspectScaling, 0, 0);
The problem is that when I run my game on any other monitor with a different resolution, the game itself is still drawn fine, but the GUI is drawn incorrectly. Basically, its just the display_set_gui_size() and display_set_gui_maximise() functions that are giving me a problem. I've tried messing with resolution ratios, and I've watched Pixelated Pope's youtube tutorials on cameras, as well as Shaun Spalding, but I can't seem to get it down.
What I need is some way to get the aspect ratio and correctly change the GUI so that everything still draws correctly.