Redcakes
Member
So I made a camera and I have it working. The only thing now is I want to allow players to press F4 to switch it into fullscreen.
I have this code in a persistent object:
...which sets the camera to the settings I have specified in other lines of code BUT should only do so if the variable "fullscreen" is set to false.
So here in a different persistent object I have this code:
...which creates the global variable "fullscreen" and then checks if F4 is clicked and if so changes the window to fullscreen and sets the variable "fullscreen" to true which should stop the previous code from running and setting it back to windowed.
Instead of pressing F4 and getting a fullscreen window nothing happens and it is stuck in windowed mode. I have no idea what I'm doing wrong as I've looked through the manual and tested that replacing the first code with just global.fullscreen = true; makes it full screen (which it does) so if anyone could help and explain why this doesn't work and how to fix it please help.
I have this code in a persistent object:
if(global.fullscreen = false){
window_set_size(displayWidth,displayHeight);
}
...which sets the camera to the settings I have specified in other lines of code BUT should only do so if the variable "fullscreen" is set to false.
So here in a different persistent object I have this code:
global.fullscreen = false;
if keyboard_check(vk_f4){
global.fullscreen = true;
window_set_fullscreen(1);
}
...which creates the global variable "fullscreen" and then checks if F4 is clicked and if so changes the window to fullscreen and sets the variable "fullscreen" to true which should stop the previous code from running and setting it back to windowed.
Instead of pressing F4 and getting a fullscreen window nothing happens and it is stuck in windowed mode. I have no idea what I'm doing wrong as I've looked through the manual and tested that replacing the first code with just global.fullscreen = true; makes it full screen (which it does) so if anyone could help and explain why this doesn't work and how to fix it please help.