Hi, i'm using Jeremy Cannady's enemy HP Bar Gauge script, I wonder if there is anyway to change the gauge's height? like i want to make it slimmer
The code to draw the gauge should be this if i'm not wrong
The whole plugin is here
forums.rpgmakerweb.com
*I posted this to the wrong thread, sorry, really appriciated if you move this to the right thread for me, because i dont know how to, thanks!
The code to draw the gauge should be this if i'm not wrong
Code:
//FUNCTION: draw the hp guage
Enemy_Bars.prototype.drawBar = function() {
//Go through the enemies and draw the bars
for(var i = 0; i < $gameTroop._enemies.length; i++){
var enemyId = $gameTroop._enemies[i]._enemyId;
var selected = $gameTroop._enemies[i]._selected;
if(BattleManager._phase === "action" || BattleManager._phase === "turn"){
var turn = true
}else{
var turn = false
console.log(BattleManager._phase)
};
var enabled = false;
var meta = new Array(4);
meta[0] = $dataEnemies[enemyId].meta.hpBar
meta[1] = $dataEnemies[enemyId].meta.hpBarSelectionOnly
meta[2] = $dataEnemies[enemyId].meta.hpBarTurnASelection
meta[3] = $dataEnemies[enemyId].meta.hpBarTurnOnly
if(meta[0]){
enabled = true;
}else if(meta[1] && selected){
enabled = true;
}else if(meta[2] && (selected || turn)){
enabled = true;
}else if(meta[3] && turn){
enabled = true;
}else{
enabled = false;
}
//Current hp
var currentHp = $gameTroop._enemies[i]._hp;
//If the enemy hp is not zero then draw the hp bar
if(currentHp > 0 && enabled){
//Max hp defined from the enemies parameters.
var maxHp = $dataEnemies[enemyId].params[0];
//Rate is the currnet hp compared to the max hp
var rate = currentHp/maxHp;
//Width of the bar
var width = $dataEnemies[enemyId].battlerWidth / 2;
var xOffset = $dataEnemies[enemyId].battlerWidth / 2 - 43 ;
var x = $gameTroop._enemies[i]._screenX - xOffset;
var y = $gameTroop._enemies[i]._screenY - 32;
//Draw the guage
this.drawGauge(x, y, width, rate , this.guageColor(0.1), this.guageColor(0.1));
};
};
};
Enemy Hp Bars
This script I am developing displays the enemies hp bar above their sprite. As they get weakened the bar will go from green>yellow>orange>red. Once they are dead the bar will disappear. Please note that this script is largely untested as it was just developed. If there are any bugs let me...
forums.rpgmakerweb.com
*I posted this to the wrong thread, sorry, really appriciated if you move this to the right thread for me, because i dont know how to, thanks!
