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

resizing camera stretches sprites and gui.

ETHC33

Member
I'm trying to make my game run fullscreen. i can do that by changing the camera size, but it makes everything either zoomed out or stretched. My camera is currently 700 width and 564 height. if i make it wider or shorter i can get the right shape for fullscreen. but everything gets stretched. I would like for it to just show more to the sides rather than resizing everything. Is there anyone who could help with this?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
If you want to full screen your game you have to either make sure that your camera is adaptive to the screen aspect ratio, or use the Game Option to maintain aspect ratio. From what you say you seem to want it to simply adapt, so you'll need to do the following:
  1. detect when the game goes fullscreen (can be done using the window_ functions)
  2. get the display aspect ratio (width / height)
  3. set the camera width to the camera height * aspect ratio
  4. you will also need to set the view PORT size this way, and probably the window too.
Tbh, all this should be done on GameStart, imho. If you are happy to show more/less of visible game area based on screen aspect ratio, then just do these calculations at the start of the game so that the game window is ALWAYS aspect ratio corrected regardless of whether it is windowed or fullscreen.
 

ETHC33

Member
no window functions are working for me, in draw_gui event,
if window_get_fullscreen()
{
draw_set_color(c_white)
draw_text(mouse_x, mouse_y, "Fullscreen is ON");
}
else {
cam_width = cam_height * ar
draw_text(mouse_x, mouse_y, "Fullscreen is OFF");
}

the text always says fullscreen is off.
 
Top