Hi all
Can anyone point me in the direction of how window layers are decided? I've created a new window in the battle scene that shows status icons, which is all fine other than when the battle ends the transparent window I've created creates a 'hole' in the xp/gold window.
Thanks!
By default all windows are drawn on the same layer, and the priority is given to the last one drawn. That means that the order you call the createSomethingWindow() function is the order that they will override each other on screen. If you want a particular window to be drawn under another one, you either need to call the function that creates it before the window you want it under, or by manually moving the index it resides inside in the windowlayer parent.
I'm not actually sure how you'd do the second thing effectively, or if it would even have an effect on the window priority after the scene was already drawn, tbh.
To get the window to draw in between other windows would also be difficult with a simple alias. Since you'd alias the scene.create function to add in your own window normally, you'd only be able to draw it after every other window is drawn, by adding the function after the alias call, or before all the other windows are drawn by calling it before. You'd probably have to alias the function that creates the xp/gold window and add the creation of your window to that function instead, to make it so that only that window (or any drawn after it) will show up on top of yours.
Ah, that'll be why I can't find it as a property of the window then! Thank you.
The xp/gold window isnt part of a scene and is drawn on-the-fly at the end of a battle so it will always be the last thing to be drawn, so it should be on the top layer? My status window is created at battle scene creation so I don't understand why the transparency bleeds through... Unless I'm just misunderdtanding what you're saying?
I don't generally mess with windows in the battle scene, so I'm not 100% sure about that, but for example, the menu scene creates all windows immediately when entering the scene, and simply hides the ones that don't show immediately, and I expect that's what the battle scene does as well.
For example, the party window is drawn on the item scene, for when you go to use an item on a party member, but that window isn't immediately visible until you actually go to use the item. The window is still created when the scene is loaded, though. And since the window is created after the item list, and other windows in that scene, when you go to use that item on someone, the party window shows up on top of the other windows.
There was a plugin kicking around that made all windows draw on their own layers, which would make your transparent window no longer eat into the windows it is showing on top of. I think SRD made it. I'm not sure if it's still around, or how compatible it is, though.
Cool, thank you both very much for your help, I'll have a look at the srd plugin.