- Joined
- May 25, 2018
- Messages
- 27
- Reaction score
- 15
- First Language
- Italian
- Primarily Uses
- RMMV
Hi again!
I have a small problem with the window_menustatus and can't figure out yet how to fix it. I made new gauge bars for replace the default one, and they are working fine, but seem I cant animate all them. The code that draw the hp gauge bar is this (ignore the last line "push"):
This will draw a hp gauge for each character in party and is working. For animate it I just simply used a update like this:
The animation work, BUT only for the last hp gauge that is draw, precisely the last party member in the party list.
I have try to use that push (the one I said to ignore) to send this._HP_GAUGE in a outside array and then set the update like this:
Here the animation work for every character, but once hp drop below the max hp... the animation stop working (???).
I know another way to accomplish that and is working but that would involve a function with " this._HPGauge = []; for (i = 0; i < $gameParty.size(); i++) {code for the gauge and this._HPGauge.push(this._HP_GAUGE);}" and I find it drastic...
Thank you kindly for whoever reply and/or help!
I have a small problem with the window_menustatus and can't figure out yet how to fix it. I made new gauge bars for replace the default one, and they are working fine, but seem I cant animate all them. The code that draw the hp gauge bar is this (ignore the last line "push"):
Code:
Window_MenuStatus.prototype.drawHpGauge = function(index) {
var actor = $gameParty.members()[index];
this._HP_GAUGE = new TilingSprite(ImageManager.loadMenu(st_gauge_hp));
var rect = this.itemRect(index);
var x = rect.x;
var y = 0;
var width = Math.ceil((actor.hp * 176) / actor.mhp);
this._HP_GAUGE.move(x + 42, y + 282, width, 14);
this.addChild(this._HP_GAUGE);
//_HPGauge.push(this._HP_GAUGE);
};
Code:
Window_MenuStatus.prototype.update = function() {
this._HP_GAUGE.origin.x += 1;
};
I have try to use that push (the one I said to ignore) to send this._HP_GAUGE in a outside array and then set the update like this:
Code:
Window_MenuStatus.prototype.update = function() {
for (i = 0; i < $gameParty.size(); i++) {
this._HPGauge[i].origin.x += 1;
};
};
I know another way to accomplish that and is working but that would involve a function with " this._HPGauge = []; for (i = 0; i < $gameParty.size(); i++) {code for the gauge and this._HPGauge.push(this._HP_GAUGE);}" and I find it drastic...
Thank you kindly for whoever reply and/or help!

