Hey,
I am using the Yanfly Window_BattleStatus, which add actor faces in the battle status window.
I am also using an in-battle Party switch, which allows to switch actors during battle by adding a command.
My issue is that whenever I switch characters, the face of the replaced character still remains under the new one. The face of the new character is displayed above the face of the replaced character without removing it.
I am trying to figure how to do remove it but I have not managed to until now.
Apparently I can't find how to "dispose" those face bitmaps and I can't find any rgss-like 'clear' command.
This is the code for drawing faces :
Now my question is how to manually or auto remove those faces when I am switching actors in-battle ?
Thank you for any help.
I am using the Yanfly Window_BattleStatus, which add actor faces in the battle status window.
I am also using an in-battle Party switch, which allows to switch actors during battle by adding a command.
My issue is that whenever I switch characters, the face of the replaced character still remains under the new one. The face of the new character is displayed above the face of the replaced character without removing it.
I am trying to figure how to do remove it but I have not managed to until now.
Apparently I can't find how to "dispose" those face bitmaps and I can't find any rgss-like 'clear' command.
This is the code for drawing faces :
Code:
Window_BattleStatus.prototype.drawStatusFace = function(index) {
var actor = $gameParty.battleMembers()[index];
var rect = this.itemRect(index);
var ww = Math.min(rect.width - 8, Window_Base._faceWidth);
var wh = Math.min(rect.height - 8, Window_Base._faceHeight);
var wx = rect.x + rect.width - ww - 6;
var wy = rect.y + 4;
this.drawActorFace(actor, wx+3, wy, ww-1.5, wh-30);
};
Window_BattleStatus.prototype.drawFace = function(fn, fi, x, y, width, height) {
width = width || Window_Base._faceWidth;
height = height || Window_Base._faceHeight;
var bitmap = ImageManager.loadFace(fn); //+"B");
var pw = Window_Base._faceWidth;
var ph = Window_Base._faceHeight;
var sw = Math.min(width, pw);
var sh = Math.min(height, ph);
var dx = Math.floor(x + Math.max(width - pw, 0) / 2);
var dy = Math.floor(y + Math.max(height - ph, 0) / 2);
var sx = fi % 4 * pw + (pw - sw) / 2;
var sy = Math.floor(fi / 4) * ph + (ph - sh) / 2;
this._faceContents.bitmap.blt(bitmap, sx, sy+12, sw, sh-25 , dx, dy);
};
Now my question is how to manually or auto remove those faces when I am switching actors in-battle ?
Thank you for any help.