Khao
Member
Currently setting up some proper display options for my game. Everything works and saves as it should but something's... Off about the resolution of the game and it completely stopped making sense to me unless the display_get_gui_width/height functions are straight up lying to me... which I highly doubt.
This is my menu. Everything in this screen is being drawn in the draw_gui event. Resolution is set to 1024x576.
Except... Everything still appears smooth. The resolution absolutely changed. The "1024x576" number in the corner of the screen is absolutely correct, as it's literally being drawn by doing:
If those numbers are correct... It's impossible for the menu to look as smooth as it does. That's still a 1080p image.
Soooo... how do I know resolution is actually being changed? Well, in-game, things look like this.
Game is absolutely running at 1024x576, as everything looks super pixelated. Everything except the gui. But again, display_get_gui_width and display_get_gui_height are still returning 1024 and 576 respectively, so why the heck is the UI so high-res? The even weirder part is that I'm actually scaling my GUI draw stuff so they remain at a consistent size at all resolutions, and if I don't do that, everything displays at the size you'd expect from a smaller gui layer. It genuinely makes no sense whatsoever to me. Absolutely everything is pointing towards the gui layer being resized correctly, from numbers, to coordenates, to the scaling adjustments I have to make... but everything is still displayed at a higher res than the numbers would tell you. If the UI layer is really being scaled correctly, then an UI as smooth as I'm getting would be impossible.
This is my code for changing resolutions:
Any ideas? Am I missing a step? And also if I'm missing a step why the heck is are display_get_gui_width and display_get_gui_height returning the wrong values?
This is my menu. Everything in this screen is being drawn in the draw_gui event. Resolution is set to 1024x576.
Except... Everything still appears smooth. The resolution absolutely changed. The "1024x576" number in the corner of the screen is absolutely correct, as it's literally being drawn by doing:
Code:
draw_text(20,20,string(display_get_gui_width())+"x"+string(display_get_gui_height()))
Soooo... how do I know resolution is actually being changed? Well, in-game, things look like this.
Game is absolutely running at 1024x576, as everything looks super pixelated. Everything except the gui. But again, display_get_gui_width and display_get_gui_height are still returning 1024 and 576 respectively, so why the heck is the UI so high-res? The even weirder part is that I'm actually scaling my GUI draw stuff so they remain at a consistent size at all resolutions, and if I don't do that, everything displays at the size you'd expect from a smaller gui layer. It genuinely makes no sense whatsoever to me. Absolutely everything is pointing towards the gui layer being resized correctly, from numbers, to coordenates, to the scaling adjustments I have to make... but everything is still displayed at a higher res than the numbers would tell you. If the UI layer is really being scaled correctly, then an UI as smooth as I'm getting would be impossible.
This is my code for changing resolutions:
Code:
var dw=global.resolution_width
var dh=global.resolution_height
room_set_viewport(room,view_camera[0],1,0,0,dw,dh)
surface_resize(application_surface, dw, dh)
display_set_gui_size(dw,dh)
Last edited: