- Joined
- Jan 6, 2018
- Messages
- 18
- Reaction score
- 7
- First Language
- Portuguese
- Primarily Uses
- RMMV
Hello everyone, how are you? I would like someone to help with something. I tried to understand how the creation of the status window works on the menu and I could not, so I decided to create a mask, leaving the windows invisible and using the index of the members to display pictures and etc. Recently I was trying to insert member information into the image, such as level, current and maximum hp, and current and maximum mp. I used the code below for this:
This will check the total members and create a picture for each one. So, on update, I made them appear:
The sistem works, the pictures (with the actor face) show on Scene_Menu, but the problem is that the texts only appear written the second time that I return to the main menu.
Can someone help me figure out how to fix this?
Code:
Scene_Menu.prototype.janelaStatus = function() {
var totalMembros = $gameParty.members().length;
switch(totalMembros) {
case 1:
// Personagem 1
this._personagem1 = new Sprite();
this._personagem1.x = Graphics.width - 590;
this._personagem1.y = 32;
this.addChildAt(this._personagem1, 2);
break;
case 2: // A ordem dos membros é de do maior pro menor para sobrepor a ordem das pictures.
// Personagem 2
this._personagem2 = new Sprite();
this._personagem2.x = Graphics.width - 628;
this._personagem2.y = 135;
this.addChildAt(this._personagem2, 2);
// Personagem 1
this._personagem1 = new Sprite();
this._personagem1.x = Graphics.width - 590;
this._personagem1.y = 32;
this.addChildAt(this._personagem1, 2);
break;
case 3: // A ordem dos membros é de do maior pro menor para sobrepor a ordem das pictures.
// Personagem 3
this._personagem3 = new Sprite();
this._personagem3.x = Graphics.width - 673;
this._personagem3.y = 257;
this.addChildAt(this._personagem3, 2);
// Personagem 2
this._personagem2 = new Sprite();
this._personagem2.x = Graphics.width - 628;
this._personagem2.y = 135;
this.addChildAt(this._personagem2, 2);
// Personagem 1
this._personagem1 = new Sprite();
this._personagem1.x = Graphics.width - 590;
this._personagem1.y = 32;
this.addChildAt(this._personagem1, 2);
break;
}
};
Code:
Scene_Menu.prototype.update = function() {
Scene_Base.prototype.update.call(this);
//Exibe a imagem dos personagens e os dados deles pelos membros do grupo.
var totalMembros = $gameParty.members().length;
switch(totalMembros) {
case 1:
// Personagem 1
this._personagem1.bitmap = ImageManager.loadPicture($gameParty.members()[0]._name);
this._personagem1.bitmap.drawText($gameParty.members()[0]._level, 40, 40, 50, 50, 'center');
this._personagem1.bitmap.fontSize = 50;
break;
case 2: // A ordem dos membros é de do maior pro menor para sobrepor a ordem das pictures.
// Personagem 2
this._personagem2.bitmap = ImageManager.loadPicture($gameParty.members()[1]._name);
this._personagem2.bitmap.drawText($gameParty.members()[1]._level, 40, 40, 50, 50, 'center');
this._personagem2.bitmap.fontSize = 50;
// Personagem 1
this._personagem1.bitmap = ImageManager.loadPicture($gameParty.members()[0]._name);
this._personagem1.bitmap.drawText($gameParty.members()[0]._level, 40, 40, 50, 50, 'center');
this._personagem1.bitmap.fontSize = 50;
break;
case 3: // A ordem dos membros é de do maior pro menor para sobrepor a ordem das pictures.
// Personagem 3
this._personagem3.bitmap = ImageManager.loadPicture($gameParty.members()[2]._name);
this._personagem3.bitmap.drawText($gameParty.members()[2]._level, 40, 40, 50, 50, 'center');
this._personagem3.bitmap.fontSize = 50;
// Personagem 2
this._personagem2.bitmap = ImageManager.loadPicture($gameParty.members()[1]._name);
this._personagem2.bitmap.drawText($gameParty.members()[1]._level, 40, 40, 50, 50, 'center');
this._personagem2.bitmap.fontSize = 50;
// Personagem 1
this._personagem1.bitmap = ImageManager.loadPicture($gameParty.members()[0]._name);
this._personagem1.bitmap.drawText($gameParty.members()[0]._level, 40, 40, 50, 50, 'center');
this._personagem1.bitmap.fontSize = 50;
break;
}
};
Can someone help me figure out how to fix this?

