Perecent HP HUD Request

Hi, I would like to request a simple script where the first party members HP is displayed in percents at all times.

Please Note:

-First Party Member Only

-Percent only

-Do not make the HUD disappear when speaking to objects

I hope this is easy for you guys to do!

Thank you.
I made a sketch of what I want it to look like if this helps at all:

[IMG]http://i.imgur.com/3BLekyC.png[/IMG]
Spoiler
Code:
module EVG  module PercentHudConfig    LABEL = "HP:"    FONT = {} # do not edit    FONT[:size]   = 24    FONT[:bold]   = false    FONT[:italic] = false    FONT[:color]  = Color.new(240, 0, 0, 255)  end  class PercentHud < Sprite    include PercentHudConfig    def initialize(*args)      super(*args)      self.x = 0      self.y = 0      create_bitmap      @temp_hp = nil      refresh    end    def actor      $game_party.leader    end    def percent_hp      "#{(actor.hp.to_f / actor.mhp * 100).to_i}%"    end    def create_bitmap      self.bitmap = Bitmap.new(Graphics.width, Graphics.height)      FONT.each {|m, v| self.bitmap.font.send("#{m}=", v)}    end    def refresh      self.bitmap.clear      @temp_hp = actor.hp      draw_label      draw_percent_hp    end    def draw_label      self.bitmap.draw_text(4, 0, Graphics.width, FONT[:size], LABEL)    end    def draw_percent_hp      self.bitmap.draw_text(4, FONT[:size], Graphics.width, FONT[:size], percent_hp)    end    def update      super      refresh if need_refresh?    end    def need_refresh?      @temp_hp != actor.hp    end  endendclass Spriteset_Map  alias :evg_sm_cp_ph11     :create_pictures  def create_pictures    evg_sm_cp_ph11    @percent_hud = EVG::PercentHud.new(@viewport2)  end  alias :evg_sm_up_ph11     :update_pictures  def update_pictures    evg_sm_up_ph11    @percent_hud.update  end  alias :evg_sm_dp_ph11     :dispose_pictures  def dispose_pictures    evg_sm_dp_ph11    @percent_hud.bitmap.dispose    @percent_hud.dispose  endend
Spoiler
module EVG module PercentHudConfig LABEL = "HP:" FONT = {} # do not edit FONT[:size] = 24 FONT[:bold] = false FONT[:italic] = false FONT[:color] = Color.new(240, 0, 0, 255) end class PercentHud < Sprite include PercentHudConfig def initialize(*args) super(*args) self.x = 0 self.y = 0 create_bitmap @temp_hp = nil refresh end def actor $game_party.leader end def percent_hp "#{(actor.hp.to_f / actor.mhp * 100).to_i}%" end def create_bitmap self.bitmap = Bitmap.new(Graphics.width, Graphics.height) FONT.each {|m, v| self.bitmap.font.send("#{m}=", v)} end def refresh self.bitmap.clear @temp_hp = actor.hp draw_label draw_percent_hp end def draw_label self.bitmap.draw_text(4, 0, Graphics.width, FONT[:size], LABEL) end def draw_percent_hp self.bitmap.draw_text(4, FONT[:size], Graphics.width, FONT[:size], percent_hp) end def update super refresh if need_refresh? end def need_refresh? @temp_hp != actor.hp end endendclass Spriteset_Map alias :evg_sm_cp_ph11 :create_pictures def create_pictures evg_sm_cp_ph11 @percent_hud = EVG:😛ercentHud.new(@viewport2) end alias :evg_sm_up_ph11 :update_pictures def update_pictures evg_sm_up_ph11 @percent_hud.update end alias :evg_sm_dp_ph11 :dispose_pictures def dispose_pictures evg_sm_dp_ph11 @percent_hud.bitmap.dispose @percent_hud.dispose endend
Thank you so much! I absolutely love it!

Original thread: https://forums.rpgmakerweb.com/threads/perecent-hp-hud-request.36079/