Easiest way to create a very simple window that can be opened on a script call

I am curious as to how this can be done. The documentation seems to be lacking examples and the scripts I have been looking at don't make much sense due to there lack of documentation. So my question is simple, how do I create a 100x100 centered window with an icon and the words hello world.

Can some one paste an example of how this would be done? I have been working on a script  and looking through the core scripts on how to do this, Its not that clear ..... to me at least >.>
var window = new Window_Base(x, y, width, height);window.drawText("Hello World", x, y, maxWidth, lineHeight, alignment);window.drawIcon(iconindex, {x: xpos, y: ypos});The draw icon bit kinda sucks, in my opinion, because it was designed to work with window message, which has a textState object with x and y poses. The drawIcon function uses those positions to draw at a certain spot, so you need to pass in an object like that. Kinda sloppy in my opinion, but whatever.

I'm not entirely sure how this will hold up in a script call. I don't think there's automatic garbage collection like in Ruby, so it should continue to live after your script call, however once the script call ends, there will no long be any reference to that window and it'll just hang out there until the scene changes or the game reloads. You'll have to set it somewhere with a wider scope to keep a reference to it.
var window = new Window_Base(x, y, width, height);window.drawText("Hello World", x, y, maxWidth, lineHeight, alignment);window.drawIcon(iconindex, {x: xpos, y: ypos});The draw icon bit kinda sucks, in my opinion, because it was designed to work with window message, which has a textState object with x and y poses. The drawIcon function uses those positions to draw at a certain spot, so you need to pass in an object like that. Kinda sloppy in my opinion, but whatever.

I'm not entirely sure how this will hold up in a script call. I don't think there's automatic garbage collection like in Ruby, so it should continue to live after your script call, however once the script call ends, there will no long be any reference to that window and it'll just hang out there until the scene changes or the game reloads. You'll have to set it somewhere with a wider scope to keep a reference to it.
I made an event here with your code but nothing happens.

3a2z.png


(I also tried to rename window to other names)
var window = new Window_Base(x, y, width, height);window.drawText("Hello World", x, y, maxWidth, lineHeight, alignment);window.drawIcon(iconindex, {x: xpos, y: ypos});

Does the window open automatically? I see .open  a lot, how do you close the window on user input of esc 
I made an event here with your code but nothing happens.

3a2z.png


(I also tried to rename window to other names)

Does the window open automatically? I see .open  a lot, how do you close the window on user input of esc 

Oh crap, I just remembered that, new to MV, you need to add the window to the scene for it to be displayed. My mistake!

var window = new Window_Base(x, y, width, height);window.drawText("Hello World", x, y, maxWidth, lineHeight, alignment);window.drawIcon(iconindex, {x: xpos, y: ypos});// Since we're in the terms of Game_Interpreter, we need to use a little workaround:SceneManager._scene.addWindow(window);That oughta do it.

EDIT:

Does the window open automatically? I see .open  a lot, how do you close the window on user input of esc 
for closing it on user input, you're going to want to make a custom window class, or change Scene_Map to close that window and not open the menu, or make sure that window isn't open first before trying to open the menu. It's a bit more involved to do that, and I have realized the documentation sucks on explaining how to do things, and instead just explains a small part of the core scripts.
Oh crap, I just remembered that, new to MV, you need to add the window to the scene for it to be displayed. My mistake!

var window = new Window_Base(x, y, width, height);window.drawText("Hello World", x, y, maxWidth, lineHeight, alignment);window.drawIcon(iconindex, {x: xpos, y: ypos});// Since we're in the terms of Game_Interpreter, we need to use a little workaround:SceneManager._scene.addWindow(window);That oughta do it.
Wow thanks very much. It's the first time I see something appear on the screen! ^^

This is the first step for me to create a custom interface.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/easiest-way-to-create-a-very-simple-window-that-can-be-opened-on-a-script-call.46899/