I'm able to get the node webkit app to load full screen with this in my html's javascript:
"use strict";
const gui = require('nw.gui');
var win = gui.Window.get();
win.enterFullscreen();
So after reading https://github.com/nwjs/nw.js/wiki/Screen , I tried this:
"use strict";
const gui = require('nw.gui');
var win = gui.Window.get();
var screen = gui.Screen.Init();
var onDisplayBoundsChanged = function(screen) {
alert("hey");
}
gui.Screen.on('displayBoundsChanged', onDisplayBoundsChanged);
// win.enterFullscreen();
win.maximize();
window.client = new GameClient(screen);
I never see the alert. Ideally I want to delay
window.client = new GameClient(screen);
until after the application fullscreens and has a new, full screen bounds I can use.
How do I detect full-screen and get the width & height?
I misunderstood what gui.Screen.Init() was returning.
Change
var screen
tovar screen = gui.Screen.Init().screens[0];
then