All pastes #1971104 Raw Edit

Fancy HUD Script

public ruby v1 · immutable
#1971104 ·published 2010-10-23 16:58 UTC
rendered paste body
#=====================================================#  Fancy HUD by arev#  Updated: Oct 23rd 2010#  Visit rmdump.blogspot.com for more RMXP resources#=====================================================HIDE_SWITCH_ID = 1class Game_Actor  attr_reader   :exp_listendclass Window_HUD < Window_Base  def initialize    super(93, 352, 454, 128)    if $game_switches[HIDE_SWITCH_ID] == true      self.y = 480    end    self.contents = Bitmap.new(422,96)    self.windowskin = RPG::Cache.windowskin('')    refresh  end  def refresh    self.contents.clear    self.contents.blt(0,0, RPG::Cache.picture("hud_back.png"),Rect.new(0,0,422,96),128)        @actor = $game_party.actors[0]    percent_life = 180.00    percent_life *= @actor.hp    percent_life /= @actor.maxhp    self.contents.blt(182-percent_life,72,RPG::Cache.picture("hp.png"),Rect.new(180-percent_life,0,percent_life,12))        percent_mana = 180.00    percent_mana *= @actor.sp    percent_mana /= @actor.maxsp    self.contents.blt(240,72,RPG::Cache.picture("sp.png"),Rect.new(0,0,percent_mana,12))        percent_exp = 88.00    percent_exp *= (@actor.exp - @actor.exp_list[@actor.level])    percent_exp /= (@actor.exp_list[@actor.level+1] - @actor.exp_list[@actor.level])    self.contents.blt(167,93-percent_exp, RPG::Cache.picture("exp.png"),Rect.new(0,88-percent_exp,88,percent_exp),255)        self.contents.blt(0,0, RPG::Cache.picture("hud.png"),Rect.new(0,0,422,96),255)      endendclass Scene_Map  alias hos_main main  alias hos_update update  def main    @hud = Window_HUD.new    hos_main    @hud.dispose  end  def update    @hud.refresh    if $game_switches[HIDE_SWITCH_ID] == true && @hud.y < 480      @hud.y += 4    elsif $game_switches[HIDE_SWITCH_ID] == false && @hud.y > 352      @hud.y -= 4    end    hos_update  endend