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.

Script detecting fullscreen or window

So... I'm using this for toggle fullscreen ingame by choices (I found that on this forum.):

$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)
$full = 1

Then... I made some event-based cheat system and one of cheats displays false BSOD on full screen, then some black screen, and, if the game runs in window, it brings back the window.
(Don't ask why bsod, just look at that)

@>Conditional Branch: [] is name 'msflightsim95' applied
@> Conditional Branch: Switch [0039: foolscreen] == ON (the question about fullscreen on start of new game toggle this)
@> Fade Out BGM: 1 sec.
@> Show Picture: 50, 'bsod-vista', Upper Left (0,0), (100%, 100%), 255, Normal
@> Wait: 3 frame(s)
@> Erase Picture: 50
@> Show Picture: 49, 'black', Upper Left (0,0), (100%, 100%), 255, Normal
@> Wait: 15 frame(s)
@> Erase Picture: 49
@> Play BGM: 'instrumental', 100, 100
@> Break Loop

: Else

THE SAME BUT ON FIRST:
$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)
$full = 1

AND ON THE END:

$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)
$full = 0

So... If on start of new game I toggle fullscreen by choices, it displays on fullscreen. If I decide the game will run in window, it toggles fullscreen and on the end it brings back the window. But if I decide the game will run in window and then press alt+enter or i decide to toggle fullscreen and press alt+enter to get back to window... yeah, that's the shit.

So, is it possible to write script to detect fullscreen other way than by switches?

It may be stupid but my game will be very humorous and that's an element of one quest in game scenario. :>

I have also more important question about display of pictures but it's later, I have time. :>

If someone can help me, thanks very much!
 

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