Forgive my doubt, but I have been searching and I can't find what could cause the problem.
I have created a window class that inherits from Windows_Base, I am interested in drawing the faces of the characters.
The problem is that the drawFace method will not be executed until the 2nd execution of the code. I understand that there must be something strange in the update method.
so I've tried forcing an update() right after adding the faces, but this doesn't solve anything. And until you close and reopen the window, the drawing of the face will still not appear.
What could be happening?
The window code is:
And the function that creates the window
I have created a window class that inherits from Windows_Base, I am interested in drawing the faces of the characters.
The problem is that the drawFace method will not be executed until the 2nd execution of the code. I understand that there must be something strange in the update method.
so I've tried forcing an update() right after adding the faces, but this doesn't solve anything. And until you close and reopen the window, the drawing of the face will still not appear.
What could be happening?
The window code is:
JavaScript:
//classes
class MonsterWindow extends Window_Base {
constructor(...args) {
super(...args)
this.makeTable()
};
makeTable() {
this.drawFace("Actor1",1,10,120,200,200)
};
update() {
this.updateTone();
this.updateOpen();
this.updateClose();
this.updateBackgroundDimmer();
if (Input.isTriggered("tab")){
this.close()
}
};
And the function that creates the window
HTML:
function makeWindow(){
var myWindow = new MonsterWindow(new Rectangle(10,10,400,300))
var scene = SceneManager._scene
scene.addChild(myWindow)
}