Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

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

imagem2u.png


Script



Code:
=begin

Script created by Brekamp

=end

 

class Window_Base < Window

  Back_Color = Color.new(0, 255, 0)

  HP_Color = Color.new(255, 0, 0)

  SP_Color = Color.new(0, 0, 255)

  def draw_gauge(x, y, width, height, value, max, gauge_color, opacity = 255)

    gauge_bitmap = Bitmap.new(width, height)

    gauge_bitmap.fill_rect(0, 0, width, height, Back_Color)

    gauge_width = width * value / max

    gauge_bitmap.fill_rect(0, 0, gauge_width, height, gauge_color)

    self.contents.blt(x, y, gauge_bitmap, Rect.new(0, 0, width, height), opacity)

    gauge_bitmap.dispose

  end

 

  def draw_actor_hp_gauge(actor, x, y, width, height, opacity)

    draw_gauge(x, y, width, height, actor.hp, actor.maxhp, HP_Color, opacity)

  end

  def draw_actor_sp_gauge(actor, x, y, width, height, opacity)

          draw_gauge(x, y, width, height, actor.sp, actor.maxsp, SP_Color, opacity)

    end

  end

X = 0

Y = 0

Largura = 250

Altura = 120

class Hud < Window_Base

  def initialize

      super(X,Y,Largura,Altura)

      self.contents = Bitmap.new(width - 32, height - 32)

      @ator = 0

      self.opacity = 30

      refresh

    end

 

  def refresh

    self.contents.clear

    actor = $game_party.actors[0]       

draw_actor_exp(actor,0, 60)

draw_actor_hp(actor, 0, 20, width = 144)

draw_actor_sp(actor, 0, 40, width = 144)

draw_actor_graphic(actor, 180, 90)

      draw_actor_name(actor, 4, 0)           

      draw_actor_hp_gauge(actor, 32, 28, 128, 16, 100)

      draw_actor_sp_gauge(actor, 32, 48, 128, 16, 100)

    if $scene.is_a?(Scene_Menu)

      self.contents.clear

    end

    if $scene.is_a?(Scene_Battle)

      self.contents.clear

      self.visible = false

    end

  end

end

class Scene_Map

  alias hud_main main

  def main

    @Hud = Hud.new

    hud_main

    @Hud.dispose

  end

  alias hud_update update

  def update

    hud_update

    @Hud.update

    @Hud.refresh

  end

end

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 :biggrin:

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!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top