- Joined
- Jan 12, 2019
- Messages
- 1,544
- Reaction score
- 1,034
- First Language
- Polish
- Primarily Uses
- RMMV
Does node.js natively have a script call to remove window border? If yes, then what is it?
window
category:"frame": false
{
"name": "",
"main": "index.html",
"js-flags": "--expose-gc",
"window": {
"title": "",
"toolbar": false,
"width": 816,
"height": 624,
"icon": "icon/icon.png",
"frame": false
}
}
window.resizeTo(screen.width, screen.height)
/*:
* @target MV
* @plugindesc Use NWJS for fullscreen when appropriate.
* @author Caethyril
* @help Terms of use: free to use and/or modify for any project.
*/
(alias => {
Graphics._isFullScreen = function() {
if (Utils.isNwjs())
return nw.Window.get().isFullscreen;
return alias.apply(this, arguments);
};
})(Graphics._isFullScreen);
(alias => {
Graphics._switchFullScreen = function() {
if (Utils.isNwjs())
nw.Window.get().toggleFullscreen();
else
alias.apply(this, arguments);
};
})(Graphics._switchFullScreen);
(alias => {
Graphics._requestFullScreen = function() {
if (Utils.isNwjs())
nw.Window.get().enterFullscreen();
else
alias.apply(this, arguments);
};
})(Graphics._requestFullScreen);
(alias => {
Graphics._cancelFullScreen = function() {
if (Utils.isNwjs())
nw.Window.get().leaveFullscreen();
else
alias.apply(this, arguments);
};
})(Graphics._cancelFullScreen);
//package.json for MZ
{
"name": "rmmz-game",
"main": "index.html",
"js-flags": "--expose-gc",
"chromium-args": "--force-color-profile=srgb",
"window": {
"title": "Awesome Game",
"toolbar": false,
"fullscreen": true,
"width": 816,
"height": 624,
"position": "center",
"icon": "icon/icon.png",
"frame": false
}
}
//package.json for MV
{
"name": "",
"main": "index.html",
"js-flags": "--expose-gc",
"window": {
"title": "",
"toolbar": false,
"fullscreen": true,
"width": 816,
"height": 624,
"icon": "icon/icon.png",
"frame": false
}
}
}
These script calls all work just fine in MZ, so you probably can upgrade NW.js to 0.48.4 at least. I would imagine that there is a reason why GGG hasn't upgraded MZ's NW.js higher than that, so I personally wouldn't upgrade MV higher than that either.@Castspeller
Graphics._requestFullScreen() - swtich to full screen mode
Graphics._cancelFullScreen() - switch to window mode
and built in natively in nwjs:
nw.Window.get().enterFullScreen() - swtich to full screen mode
nw.Window.get().leaveFullScreen() - back to window mode
As I said, in older versions of nwjs (probably to version 0.40.0) entering full screen is OK, above versions causes the "bug" shown in this image.