M
Mythi.T
Guest
I want to have my game go from full screen to not full-screen and keep the resolution and pixel perfect stuff the same
My idea was:
When the window goes to fullscreen, the viewport would also be set to the size of the window, and the camera of that viewport would be set the the size of the viewport. In theory, all things should be equal, and everything will work and no pixel-ation or non-pixel-perfect displaying would occur because when the window gets bigger, so does the camera, at the same rate. The camera doesn't get stretched because it is growing and being set to the window, so yay sunshine and rainbows everything works, right?
(color added to make others and myself understand my issue better)
My code to make theory work:
however, it simply doesn't work
I know my code is setting all the stuff to the right sizes due to this:
, and those numbers I draw on the screen.
All numbers stay the same, window:camera:viewport ratio drawn on the screen SAYS it stays 1:1:1, but it what is really being drawn tells me otherwise. In reality, stuff is still pixel-y, like the camera (or viewport, idk!) isn't really changing size to match the window. But my variables tell my not. Anyone know what I am doing wrong? because my brain is fried trying to find out what the hecc is wrong. I have spent like 4+ hours trying to figure out...
My theories to whats wrong:
1. The stuff I am changing sizes of is really not the stuff that is active [stuff=camera & viewport] (now idea how to check / solve if that is the issue)
2. I am dumb? and what I am trying to do isn't possible...
3. My size-switchero method simply doesn't work on currently active rooms/viewports. (No idea how to fix if thats the issue)
Anyway please help. This is like the only obstacle I need to pass to get my game finished!
PS I do not care of the issues that evolve from having a bigger view of the game room. Just tell me how to solve my problem
My idea was:
When the window goes to fullscreen, the viewport would also be set to the size of the window, and the camera of that viewport would be set the the size of the viewport. In theory, all things should be equal, and everything will work and no pixel-ation or non-pixel-perfect displaying would occur because when the window gets bigger, so does the camera, at the same rate. The camera doesn't get stretched because it is growing and being set to the window, so yay sunshine and rainbows everything works, right?
(color added to make others and myself understand my issue better)
My code to make theory work:
Code:
camera_set_view_size(view_camera[0], window_get_width(), window_get_height());
view_set_wport(view_hport[0], window_get_width())
view_set_hport(view_hport[0], window_get_height())
I know my code is setting all the stuff to the right sizes due to this:
Code:
global.windowsizeX = window_get_width()
global.windowsizeY = window_get_height()
global.portsizeX = view_wport[0]
global.portsizeY = view_hport[0]
global.camsizeX = camera_get_view_width(view_camera[0])
global.camsizeY = camera_get_view_height(view_camera[0])
All numbers stay the same, window:camera:viewport ratio drawn on the screen SAYS it stays 1:1:1, but it what is really being drawn tells me otherwise. In reality, stuff is still pixel-y, like the camera (or viewport, idk!) isn't really changing size to match the window. But my variables tell my not. Anyone know what I am doing wrong? because my brain is fried trying to find out what the hecc is wrong. I have spent like 4+ hours trying to figure out...
My theories to whats wrong:
1. The stuff I am changing sizes of is really not the stuff that is active [stuff=camera & viewport] (now idea how to check / solve if that is the issue)
2. I am dumb? and what I am trying to do isn't possible...
3. My size-switchero method simply doesn't work on currently active rooms/viewports. (No idea how to fix if thats the issue)
Anyway please help. This is like the only obstacle I need to pass to get my game finished!
PS I do not care of the issues that evolve from having a bigger view of the game room. Just tell me how to solve my problem