MZ How to create a separate, transparent window?

What the title says. I'm making a horror game in RMMZ and wanted to implement some 4th wall breaking stuff in my game. I figured out how to do a few things, but one thing I wanted to figure out was how to create a transparent window with stuff in it.

For example, at the end of OneShot
Spoiler
where the main character walks out of the screen

Is something like this possible in RPG Maker MZ?
OneShot was made in RPG Maker, so it must be 😛

There was just a thread about this literally a few days ago. If you do a search, one poster had a few suggestions for how to start approaching it.
It's this thread
It's this thread
Thanks, I managed to get another window to open!
Only problem is, I can't seem to get the window to be transparent. I followed tutorials like setting transparent to true in package.json but it doesn't seem to be working. Am I missing something? 😅
Thanks, I managed to get another window to open!
Only problem is, I can't seem to get the window to be transparent. I followed tutorials like setting transparent to true in package.json but it doesn't seem to be working. Am I missing something? 😅
According to the docs, you'll also need to set frame to false, and make the background transparent in html.

EDIT: It might also be worth clarifying: if you want to make the additional window transparent (rather than the primary one), you wouldn't modify package.json, but the options object used when creating a window.
According to the docs, you'll also need to set frame to false, and make the background transparent in html.

EDIT: It might also be worth clarifying: if you want to make the additional window transparent (rather than the primary one), you wouldn't modify package.json, but the options object used when creating a window.
Yeah, that's what I wanted to do; make the separate window transparent. Do you mean putting in options in the window.open command?
Yeah, that's what I wanted to do; make the separate window transparent. Do you mean putting in options in the window.open command?
Yes. You might also want to check out the docs for Window, specifically the Window.open function (it works a bit differently in nwjs than in browsers). So for a transparent window you'd do something along the lines of window.open("secondWindowPath.html", {frame:false, transparent:true}, callback);.
Yes. You might also want to check out the docs for Window, specifically the Window.open function (it works a bit differently in nwjs than in browsers). So for a transparent window you'd do something along the lines of window.open("secondWindowPath.html", {frame:false, transparent:true}, callback);.
Hmm, I tried that but got no transparency instead. I could still close and minimize the window too. 😅
Hmm, I tried that but got no transparency instead. I could still close and minimize the window too. 😅
I'm afraid I can't really think of any more suggestions other than going through the links I've sent and double-checking you're doing it correctly.

If that still doesn't help, you might get more help in the nwjs discord, since this issue doesn't really have anything to do with RPG Maker. Forum rules don't let me link to it directly, but you can find it on https://nwjs.io/ .
I'm afraid I can't really think of any more suggestions other than going through the links I've sent and double-checking you're doing it correctly.

If that still doesn't help, you might get more help in the nwjs discord, since this issue doesn't really have anything to do with RPG Maker. Forum rules don't let me link to it directly, but you can find it on https://nwjs.io/ .
Got it to work!

Turns out it was reading MZ's package.json file and not the one I made specifically for the window. Added in some options into the window.open command and finally got everything to work.
Got it to work!
Nice, I'm glad you managed to do it! Could you post your exact solution here you for anyone googling this issue in the future?
Nice, I'm glad you managed to do it! Could you post your exact solution here you for anyone googling this issue in the future?
JavaScript:
const options = {
  frame: false,
  transparent: true
};

nw.Window.open('path', options);

This code worked for me :3

Though now I have the issue of needing to focus back to the main window automatically. Any script call to do that?
JavaScript:
const options = {
  frame: false,
  transparent: true
};

nw.Window.open('path', options);

This code worked for me :3

Though now I have the issue of needing to focus back to the main window automatically. Any script call to do that?
First of all, thank you for sharing the code. I was wondering exact same thing that you did, and finally got the solution after 3 days. Have you made the way to move through the 4th wall?
I've successfully loaded new transparent window, but now I am having an issue that the new window has no connection with the sprite movement -
I was willing to move the window lower as the sprite moves downways, so that the character would seem as if it got 'out' of the 1st window while its actually just walking around transparent window. But if the sprite cannot roam around new window it won't work.
If you have made your way out, can I ask for your help?

Original thread: https://forums.rpgmakerweb.com/threads/how-to-create-a-separate-transparent-window.165418/