Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Check if game is in full screen mode

Status
Not open for further replies.
I wonder if there's a hardcoded value for it, hence the whole full-screen thing is hardcoded ... I'm using the automatic full screen script thing, which makes the game simulate that the player presses Alt+Enter every time main is loaded. Of course, if you press F12 to reset, and are in full screen mode, it switches back automatically, what isn't the purpose ...
 
I don't know how F12 works but I don't know that that's possible to resolve. Variables probably reset, so even if you could check if it's in full screen, it's too early if you do it before you press F12 and too late if you do it after you press F12.

HOWEVER, it doesn't reset for me. When I press F12 in fullscreen mode, it stays full screen.
 
@Legacy: Doing this brings up an undefined local variable error for a, logically. I haven't found a way to define a variable without setting it, which would destroy the script, because the variable would set itself every time before the keyboard execution script, so it's pointless ...

@Dark: Yeah, maybe because you don't have that API script I have in Main class ... look:

Code:
$showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
  unless $DEBUG
    $showm.call(18,0,0,0)
    $showm.call(13,0,0,0)
    $showm.call(13,0,2,0)
    $showm.call(18,0,2,0)
  end

Insert it and the game will switch between the modes every time (logically).
 
unless $DEBUG and $KEYB

I think that was the code...

Now you could do this:

$showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
unless $DEBUG
if $chicken_to_night == nil
$showm.call(18,0,0,0)
$showm.call(13,0,0,0)
$showm.call(13,0,2,0)
$showm.call(18,0,2,0)
$chicken_to_night = "dead"
end
end

At F12, the global variables stay what they are, so this would work i guess
 
Before someone closes the topic.
I don't know whether this will help, but this bit of coding when used turns the game to full screen and when it's full screen it turns it back to normal:
Code:
       $game_system.se_play($data_system.decision_se)
       $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
       $showm.call(18,0,0,0)
       $showm.call(13,0,0,0)
       $showm.call(13,0,2,0)
       $showm.call(18,0,2,0)
Which is what Meâ„¢ put, but you don't need the chicken tonight thingy

Enjoy :D
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top