Help with the display of the HP and MP.

Hi. This is my first time doing a thread.
I have an issue with the display of the number of the HP and MP, being how they display.
100/100, for example. Also, the position of the abreviature of those stats, and the numbers itself
I would like to change the 100/100 to only the current hp from the character, not their maximum
Any help regartless this theme, is very apreciated
sasasasa.PNG
try saving this as a .js file and installing it as a plugin
Code:
Window_Base.prototype.drawCurrentAndMax = function(current, max, x, y,
  width, color1, color2) {
var labelWidth = this.textWidth('HP');
var valueWidth = this.textWidth('0000');
var slashWidth = this.textWidth('/');
var x1 = x + width - valueWidth;
var x2 = x1 - slashWidth;
var x3 = x2 - valueWidth;
this.changeTextColor(color1);
this.drawText(current, x1, y, valueWidth, 'right');
};
try saving this as a .js file and installing it as a plugin
Code:
Window_Base.prototype.drawCurrentAndMax = function(current, max, x, y,
  width, color1, color2) {
var labelWidth = this.textWidth('HP');
var valueWidth = this.textWidth('0000');
var slashWidth = this.textWidth('/');
var x1 = x + width - valueWidth;
var x2 = x1 - slashWidth;
var x3 = x2 - valueWidth;
this.changeTextColor(color1);
this.drawText(current, x1, y, valueWidth, 'right');
};
Thanks for the time for making this, but didnt work, it looks the same as before.
Maybe i forget to say im very new to the RPG MAKER game building? So, if i have to change something from the code, i didnt catch it
did you save your project before testing it? plugin changes dont register until you do
did you save your project before testing it? plugin changes dont register until you do
Yep! Maybe is a issue with one of my plugins? I can show them if that is a heavy thing for the plugin
Yep! Maybe is a issue with one of my plugins?
possibly
first try loading the plugin as the last one in your list. if that doesnt work, then show your plugin list.
possibly
first try loading the plugin as the last one in your list. if that doesnt work, then show your plugin list.
Now it works! As you said it, it was putting the plugin as the last one. I can move the position of the text and numbers with the same plugin changing things in the code?
I can move the position of the text and numbers with the same plugin changing things in the code?
not entirely. you can adjust the numbers with what i gave you, but nothing else. if you want to play around with the positioning of everything there, there are a few other functions you'd need.

Spoiler: functions
Code:
Window_Base.prototype.drawActorHp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.hpGaugeColor1();
    var color2 = this.hpGaugeColor2();
    this.drawGauge(x, y, width, actor.hpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.hpA, x, y, 44);
    this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width,
                           this.hpColor(actor), this.normalColor());
};

Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.mpGaugeColor1();
    var color2 = this.mpGaugeColor2();
    this.drawGauge(x, y, width, actor.mpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.mpA, x, y, 44);
    this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,
                           this.mpColor(actor), this.normalColor());
}

Window_Base.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
    var lineHeight = this.lineHeight();
    var x2 = x + 180;
    var width2 = Math.min(200, width - 180 - this.textPadding());
    this.drawActorName(actor, x, y);
    this.drawActorLevel(actor, x, y + lineHeight * 1);
    this.drawActorIcons(actor, x, y + lineHeight * 2);
    this.drawActorClass(actor, x2, y);
    this.drawActorHp(actor, x2, y + lineHeight * 1, width2);
    this.drawActorMp(actor, x2, y + lineHeight * 2, width2);
};

However, since you tried the plugin near the top and changes didnt happen, that means one or more of the plugins youre already using changes that stuff as well.
you might be fine editing some of what i gave you, but theres a chance that itll overwrite changes made by the other plugin and youll need to have the code from the other plugin specifically edited.

If you have many changes to make, then I suggest at some point making a mockup of what you want the UI to look like, making a plugin request thread, and using it to ask for all the edits you want. youll also want to list your other UI plugins as well
not entirely. you can adjust the numbers with what i gave you, but nothing else. if you want to play around with the positioning of everything there, there are a few other functions you'd need.

Spoiler: functions
Code:
Window_Base.prototype.drawActorHp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.hpGaugeColor1();
    var color2 = this.hpGaugeColor2();
    this.drawGauge(x, y, width, actor.hpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.hpA, x, y, 44);
    this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width,
                           this.hpColor(actor), this.normalColor());
};

Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.mpGaugeColor1();
    var color2 = this.mpGaugeColor2();
    this.drawGauge(x, y, width, actor.mpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.mpA, x, y, 44);
    this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,
                           this.mpColor(actor), this.normalColor());
}

Window_Base.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
    var lineHeight = this.lineHeight();
    var x2 = x + 180;
    var width2 = Math.min(200, width - 180 - this.textPadding());
    this.drawActorName(actor, x, y);
    this.drawActorLevel(actor, x, y + lineHeight * 1);
    this.drawActorIcons(actor, x, y + lineHeight * 2);
    this.drawActorClass(actor, x2, y);
    this.drawActorHp(actor, x2, y + lineHeight * 1, width2);
    this.drawActorMp(actor, x2, y + lineHeight * 2, width2);
};
;

However, since you tried the plugin near the top and changes didnt happen, that means one or more of the plugins youre already using changes that stuff as well.
you might be fine editing some of what i gave you, but theres a chance that itll overwrite changes made by the other plugin and youll need to have the code from the other plugin specifically edited.

If you have many changes to make, then I suggest at some point making a mockup of what you want the UI to look like, making a plugin request thread, and using it to ask for all the edits you want. youll also want to listing your other plugins UI plugins as well
Thanks a lot, i will considerer everything you put in the thread, again, thanks a lot!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-the-display-of-the-hp-and-mp.174754/