How do you have multiple windows open at once and overlap them?

I have a HUD in my game that I am working on and I am an amateur at javascript (I really don't know what I'm doing). I have made a decent and functional HUD.


The way that I made my HUD is such that there is a window on which I draw the contents of my HUD and then I hide the window skin, leaving the elements I desire. Obviously, this is built on Window_Base and Scene_Map (from Soul's tutorial).


The problem with this is that I am unable to see any message windows that open, my HUD has priority to these windows in rendering. How can I make sure that my HUD is on the bottom layer of the Scene_Map?


Thanks.


EDIT: Just to clarify, the HUD is sized to take up the entire display.
Bump


I noticed that the menu can overlap the HUD and I believe, based on the code, that this is on a different scene. I drew my HUD onto the Scene_Map directly and I think that message windows do the same thing, which is why the message window is invisible. So, my hypothesis is that I need to separate the HUD into its own Scene and have this render on the bottom. Unfortunately, I don't completely understand the code when I look at it and I don't know what I'm supposed to do to change this.


Could someone point me to where in the code the Scenes are actually executed? I took a look at SceneManager, but I couldn't really distinguish where this was.
UPDATE: So, by more clearly defining the shape of the UI and creating multiple windows with small boundaries, I have managed to fit the message box in by resizing it, but it still would be much easier if I could somehow have given priority of display to one of the windows on Scene_Map.
You could probably just change the Z value of the Window/Sprite to a higher value.


Scenes are handled by the Scene_XXX objects but most of their contents esp the windows have their own code contained in the Window_XXX objects
You could probably just change the Z value of the Window/Sprite to a higher value.

I took a look around for z values and I couldn't find anything pertaining to MV, but I did for VX Ace.


However, your reference to these z values led me to this, which has solved the issue! 😀 :




If anyone is having the same issue, essentially what solved the problem is instead of using addWindow() in the Scene_xxx.prototype.start function, I used addChild(), the effects of which you can read about in ^. This moved my HUD to the lowest layer of Scene_Map. 
Oh I never realized they removed the Z value in MV. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-have-multiple-windows-open-at-once-and-overlap-them.74066/