R
rbfraphael
Guest
Good afternoon!
I'm creating a little game with GameMaker-Studio for my work and I have some problems with mouse coordinates when game canvas is scaled.
Here is the function I'm using to rescale window:
It's so important because I need to delivery this game today PLEASE can someone help me??
I'm creating a little game with GameMaker-Studio for my work and I have some problems with mouse coordinates when game canvas is scaled.
Here is the function I'm using to rescale window:
Code:
// argument0 = base_width (room_width)
// argument1 = base_height (room_height)
// argument2 = width (browser_width)
// argument3 = height (browser_height)
aspect = argument0 / argument1;
if(argument2 / aspect > argument3){
width = argument3 * aspect;
height = argument3;
} else {
width = argument2;
height = argument2 / aspect;
}
window_set_size(width, height);
surface_resize(application_surface, width, height);