Brekamp HUD

Brekamp HUDVersion: 1.0
By: Brekamp

Introduction

It's a simple HUD, one of my first scripts.

Features
  • <Simple HUD>
  • <HP and SP bars>
  • Character image

Screenshots

Image

Script



script Spoiler
  1. =begin
  2. Script created by Brekamp
  3. =end
  4.  
  5. class Window_Base < Window
  6.   Back_Color = Color.new(0, 255, 0)
  7.   HP_Color = Color.new(255, 0, 0)
  8.   SP_Color = Color.new(0, 0, 255)
  9.   def draw_gauge(x, y, width, height, value, max, gauge_color, opacity = 255)
  10.     gauge_bitmap = Bitmap.new(width, height)
  11.     gauge_bitmap.fill_rect(0, 0, width, height, Back_Color)
  12.     gauge_width = width * value / max
  13.     gauge_bitmap.fill_rect(0, 0, gauge_width, height, gauge_color)
  14.     self.contents.blt(x, y, gauge_bitmap, Rect.new(0, 0, width, height), opacity)
  15.     gauge_bitmap.dispose
  16.   end
  17.  
  18.   def draw_actor_hp_gauge(actor, x, y, width, height, opacity)
  19.     draw_gauge(x, y, width, height, actor.hp, actor.maxhp, HP_Color, opacity)
  20.   end
  21.   def draw_actor_sp_gauge(actor, x, y, width, height, opacity)
  22.           draw_gauge(x, y, width, height, actor.sp, actor.maxsp, SP_Color, opacity)
  23.     end
  24.   end
  25. X = 0
  26. Y = 0
  27. Largura = 250
  28. Altura = 120
  29. class Hud < Window_Base
  30.   def initialize
  31.       super(X,Y,Largura,Altura)
  32.       self.contents = Bitmap.new(width - 32, height - 32)
  33.       @ator = 0
  34.       self.opacity = 30
  35.       refresh
  36.     end
  37.  
  38.   def refresh
  39.     self.contents.clear
  40.     actor = $game_party.actors[0]      
  41. draw_actor_exp(actor,0, 60)
  42. draw_actor_hp(actor, 0, 20, width = 144)
  43. draw_actor_sp(actor, 0, 40, width = 144)
  44. draw_actor_graphic(actor, 180, 90)
  45.       draw_actor_name(actor, 4, 0)          
  46.       draw_actor_hp_gauge(actor, 32, 28, 128, 16, 100)
  47.       draw_actor_sp_gauge(actor, 32, 48, 128, 16, 100)
  48.     if $scene.is_a?(Scene_Menu)
  49.       self.contents.clear
  50.     end
  51.     if $scene.is_a?(Scene_Battle)
  52.       self.contents.clear
  53.       self.visible = false
  54.     end
  55.   end
  56. end
  57. class Scene_Map
  58.   alias hud_main main
  59.   def main
  60.     @Hud = Hud.new
  61.     hud_main
  62.     @Hud.dispose
  63.   end
  64.   alias hud_update update
  65.   def update
  66.     hud_update
  67.     @Hud.update
  68.     @Hud.refresh
  69.   end
  70. end
Expand to see the code.


Instructions

Just create a new script above the main, copy and paste the code.

FAQ

Is there a Script like this for RMVX?
Answer: No

Credits and Thanks

I make this script alone 😀

Author's Notes

I know it's not really good, but it's the better i could do. I am a begginer

Terms and Conditions

It's free for use!

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=67560