Skip to content

Instantly share code, notes, and snippets.

@TakkunMaker
Created June 18, 2020 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakkunMaker/9053b20faee30ebf7d8192cffe712ee0 to your computer and use it in GitHub Desktop.
Save TakkunMaker/9053b20faee30ebf7d8192cffe712ee0 to your computer and use it in GitHub Desktop.
//=============================================================================
// TakkiStatusGauges.js
//=============================================================================
/*:
* @plugindesc Adds Gauges / Bars to heroes Status.
* @author Takkun v1.0
*
* @help
*
* Adds Gauges / Bars to heroes Status.
*/
var colors1 = [
"#ff8c00",
"#4169e1",
"#dc143c",
"#228b22",
"#ff1493",
"#9932cc"
];
var colors2 = [
"#ff8c00",
"#4169e1",
"#dc143c",
"#228b22",
"#ff1493",
"#9932cc"
];
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
var fillW = Math.floor(width * rate);
var gaugeY = y + this.lineHeight() - 8;
this.contents.fillRect(x - 2, gaugeY - 2, width + 4, 10, this.gaugeBackColor());
this.contents.fillRect(x - 1, gaugeY - 1, width + 2, 8, this.normalColor());
this.contents.gradientFillRect(x, gaugeY, fillW, 6, color1, color2);
};
Window_Status.prototype.drawParameters = function(x, y) {
var lineHeight = this.lineHeight();
for (var i = 0; i < 6; i++) {
paramId = i;
this.drawGauge(
x,
y + this.lineHeight() * i,
204,
parseFloat(this._actor.param(i)) / parseFloat(this._actor.paramMax(i)),
colors1[i],
colors2[i]
);
this.changeTextColor(this.systemColor());
this.drawText(TextManager.param(paramId), x, y + this.lineHeight() * i, 160);
this.resetTextColor();
this.drawText(this._actor.param(paramId), x + 140, y + this.lineHeight() * i, 60, 'right');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment