Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

This gets me 99% of the way there. Is there a way to check if fullscreen is enabled? When my options menu loads it checks to see if fullscreen is enabled and sets the on/off toggle accordingly, but without a way to check if the game is fullscreen on loading the menu this breaks.

I had implemented this with 
$gameSwitches.setValue(48, Graphics._isFullScreen())
but obviously this is no longer setting the switch correctly with this new function.

Let me see... First, in your index.js, find the following code:

ipcMain.on(     "toggleFullscreen",     function () {         toggleGameFullscreen();     } ); 

Then add this directly below it:

ipcMain.handle("isFullscreen", function () {     return win ? win.isKiosk() : false; }); 

After that, you can use the following code in your game to check whether fullscreen is enabled and set the switch accordingly:

require("electron").ipcRenderer.invoke("isFullscreen").then(function(isFullscreen) {     $gameSwitches.setValue(48, isFullscreen); }); 

This will set Switch 48 to ON when the game is in fullscreen mode, and OFF when it is not.

This got me the rest of the way there. Thank you so much for taking the time to help me out!