MV Custom Window elements

Hi all

I have successfully created a custom window in the battle scene, however I want it to display an actor's state icons. I am using the displayActorIcons () function that already exists in the window_base class, but nothing displays. I can see in the existing code that a rectangle object is often created within a window, is that necessary to display something or is that just a way of dividing up a window to make everything neat?

If anyone can offer any guidance or knows of a tutorial that would help I'd very much appreciate it.
A rectangle object is just a container for an x, y, height and width value.
Functions that use this are usually doing so to make the code more neat looking, but just using variables for those values instead has the same functionality.

Without knowing exactly what you did to create this window, there's a good chance it doesn't have access to an actor to draw the state icons from. Windows that access actor params usually do so using a (this._actor) call, which is usually inherited at window creation, or set via a function like Window_Name.prototype.setActor. You'll need to set up a similar function to set an actor in your window. I didn't look at the function in window_base to confirm, but I'd be willing to bet that it has an if check at the beginning that causes it to do nothing if (!this._actor), and since you probably never set an actor, that's probably why nothing is happening.
I had given up on this thread so I hadn't noted that this was solved. After a couple of weeks of looking at js tutorials and other people's window plugins it eventually dawned on me that the drawActorIcons function takes the window's X/y values as zero rather that the graphic box. It had been working all along but drawing them off of the screen as I was hard-coding the X/y values to be the same as the window's. ‍♂️

Thanks for taking the time to reply though!

Original thread: https://forums.rpgmakerweb.com/threads/custom-window-elements.129428/