MV Create a new window in the menu

I know that this a very noob question, but I have a hard time with this xD
I'm trying to create a window that opens at the same time as the menu. To display a summary of the story so far.
I managed to create the window using this:
Code:
var win = new Window_Base(200, 150, 500, 100); //x,y,width,height
SceneManager._scene.addChild(win) //adds the window to the curent scene
win.drawText("text", 0, 0, 500, "center"); //draws the text

(It's not in the position but that doesn't matter now.)
1663549775820.png


But the problem is that when I open the items screen, it still shows below:
1663549955492.png


What I want to achieve is:
-That the window opens along with the menu. (I could do this, but if there is a short way, the better)
-That I can update the content of the window via common event or variables, I don't know.
-That the window disappear when the menu does it.
-That allows me to use colored texts and icons.

Is there a way to do this? 🙂
Im guessing that since you created this window from scratch, you're going to have to manually close and open it when you want it to do so.

Spoiler: Window Control
You could use:
win.close()
And
win.open()
Both of the above will utilize the open/close window animation.

You could use:
win.hide()
And
win.show()
These two will simply make the window disappear/reappear.

You can use: win.contents.clear()
To clear the window of it's current text contents.

And
win.drawTextEx()
Is similar to drawText() but you can utilize available text codes.

Please note, I am sure there are many things about creating custom windows with a script call like this that are not being taken into account here. In my project, the window does not persist after opening my custom menu scene when using this method. I tested it multiple times.

You may not run in to this specific issue in your own project but I would recommend trying to implement your custom window as a plugin, rather than a script call, especially if its something you plan to utilize throughout a majority of the game.

Remember, script calls are JavaScript so you are already part of the way there.

I think the best way to do this would be to add a new window to whatever scene is calling the menu you are using.

If you want to find the name of the scene calling your menu:
Spoiler: Finding Scene Name
  1. Test play your project
  2. Open the menu in question.
  3. Press F12.
  4. It should load into the console tab, but if not, click the console tab on the top-right. It should look like this:
    Spoiler: Console
    1663556829212.png
  5. Type in SceneManager._scene and it will return the current scene object. My menu scene is called Scene_MenuCustom, so for me, it looks like this:
    Spoiler: Scene Name
    1663557145963.png

Forgive me if you already know how to do this, I just thought I'd reference it just in case, may be helpful to someone in a similar situation.
What I want to achieve is:
-That the window opens along with the menu. (I could do this, but if there is a short way, the better)
-That I can update the content of the window via common event or variables, I don't know.
-That the window disappear when the menu does it.
-That allows me to use colored texts and icons.

Is there a way to do this? 🙂

Soo there are a few things here... but rather then give a lengthy explanation.. instead I made an example plugin to show you the proper example of doing this.

Also the plugin should basically already be usable for whatever you desire. 😉
I've setup the parameters to be customizable. (all can be entered as any javascript)
Spoiler: Plugin Parameters
1663575066669.png
Example of changing the quest icon/text/text color:
Spoiler
1663575129055.png

Example of what this looks like using default settings with default menu system:
Spoiler: Window Example In-Game
1663575528598.png

CTB_ExtraMenuWindowMV Plugin: Click Here to Download

Hopefully that will help for a better understanding of how to do what you desire to do.
Take a look at the code & I'll be standing by for questions 🙂 :popcorn:

Sidenote:
Looks like your using some custom menu system. I feel like that plugin I made should still work as intended but generally it is always best when making a post to get help that you detail out what plugins or modifications are made to the default system so we can better assist. 😉☺️
You may not run in to this specific issue in your own project but I would recommend trying to implement your custom window as a plugin, rather than a script call, especially if its something you plan to utilize throughout a majority of the game.
this is probably better, I appreciate your help.
Sidenote:
Looks like your using some custom menu system. I feel like that plugin I made should still work as intended but generally it is always best when making a post to get help that you detail out what plugins or modifications are made to the default system so we can better assist. 😉☺️
I'm using > Non combat menu
Sorry not to mention it before, Your plugin doesn't work because of it . :LZSteary:
this is probably better, I appreciate your help.

I'm using > Non combat menu
Sorry not to mention it before, Your plugin doesn't work because of it . :LZSteary:

No prob. Easily enough to change.

All I had to do was change "Scene_Menu" to "Scene_NCMenu".

So I created a parameter setting for that now too 😉
Spoiler: Menu Scene Class Name Plugin Parameter
1663647437925.png
Spoiler: In Game Screenshot
1663647342785.png

So to use this now with the non-combat menu system just change the parameter to "Scene_NCMenu" (without quotes)

Edit:
Ok so now on top of all that I decided to also make the refresh code customizable if you desire by editing it in the plugin parameter of the window properties.

May be a bit overkill but hey now you can do that to if you desire 😉
Spoiler: Plugin Parameter - Customizable Refresh Code
1663649622327.png
With this now you can basically display anything you want to show and however you want in a window on the menu screen ☺️

Fully optional though.
The default setup will show an icon and text via the variables setup in the main parameters of the plugin.

lol for example now it's even simple enough now to use to show the map display name like this if you wanted to do that...
Spoiler
1663650304845.png
1663650248181.png

[v1.20] CTB_ExtraMenuWindowMV Plugin: Click Here to Download

Edit #2:
...Well this has now evolved into something I'm actually kind of proud of lol

The main thing now worthy of mentioning now about this new version is that it now takes advantage of a custom plugin I wrote that breaks the limits of the plugin manager and allows multiple instances of plugins to be used. Meaning you can have as many windows as you want by just adding the plugin to the plugin manager as many times as you want & now you can do things like this:
1663653787756.png

[v2.00] CTB_ExtraMenuWindowMV Plugin: Click Here to Download

To create multiple windows using the same plugin requires my "Plugin Manager Extended" plugin:
[v1.00] CTB_ExtraMenuWindowMV Plugin: Click Here to Download

Setup is like this:
Spoiler: Setup/Demo Video



Not gonna lie this one has become quite advanced... started off as just an example script has now become something else entirely lol
@ct_bolt Thank you so much! It's working just fine now!
but I'll bother you a little more with another silly question...
Forget it, I made it xD

And another thing, is it possible that behind the text looks transparent? the black background is displayed inside the box.
Thank you so much! It's working just fine now!
Yay! Very glad to hear that ☺️
You're very much welcome! ☺️

And another thing, is it possible that behind the text looks transparent? the black background is displayed inside the box.
Hmm.. yes of course it's possible but you mean just get rid of the whole window background?
& just leave the text? Sorry I'm just a little confused by what parts you want transparent.
...I am pretty tired at the moment though (it's 4:12am here), so I might just be overthinking it

Also I made an edit to the above post with version 2.00 if you want to check that out too.. that's the new link to the one I will make updates too.

I think I made the edit after you replied.. since I didn't see you replied until after I made the edit.
Edit #2:
...Well this has now evolved into something I'm actually kind of proud of lol

The main thing now worthy of mentioning now about this new version is that it now takes advantage of a custom plugin I wrote that breaks the limits of the plugin manager and allows multiple instances of plugins to be used. Meaning you can have as many windows as you want by just adding the plugin to the plugin manager as many times as you want & now you can do things like this:
View attachment 240881
[v2.00] CTB_ExtraMenuWindowMV Plugin: Click Here to Download

To create multiple windows using the same plugin requires my "Plugin Manager Extended" plugin:
[v1.00] CTB_ExtraMenuWindowMV Plugin: Click Here to Download

Setup is like this:
Spoiler: Setup/Demo Video



Not gonna lie this one has become quite advanced... started off as just an example script has now become something else entirely lol
I think I made the edit after you replied.. since I didn't see you replied until after I made the edit.
Yeah, I didn't see it.
It's a pretty nice implementacion to have more than one window! I was about to ask for that! :LZSsmile:
Thank you!
Hmm.. yes of course it's possible but you mean just get rid of the whole window background?
& just leave the text? Sorry I'm just a little confused by what parts you want transparent.
...I am pretty tired at the moment though (it's 4:12am here), so I might just be overthinking it
The black background I was talking is the one below the map name:

1663714380831.png

(It seems we have the same time zone.)

Btw, It is possible to use breaklines? I want to make a paragraph. I tried: \n, \\n, <br> nothing seems to work...
What about an option to align the text at the left or center?
and that's all, sorry if I bother too much.

Original thread: https://forums.rpgmakerweb.com/threads/create-a-new-window-in-the-menu.151384/