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.

Hud Request

Hello all thanks to this website and all the wonderful people here I was able to make my own HP/SP hub
http://i316.photobucket.com/albums/mm35 ... ck/Hud.jpg[/img]
WOOT GO ME!

However if you notice there is a big gap between the top of the hud and where the text is, I can not figure out why can some one please tell me why and how to fix this.  Also please note it is all text,  I would like bars so I am asking/requesting for help in making my hud look something like this
http://i316.photobucket.com/albums/mm35 ... k/Hud2.jpg[/img]
so if any of you want to show off your fancy skills please do.

Here is the script I am currently using
Code:
class Window_YourHUD < Window_Base
  def initialize
    super(0, 0, 165 , 110)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = 14
    self.opacity = 25
    refresh
  end
  def refresh
    self.contents.clear
    reset_variables
    return if !@actor
    draw_actor_name(@actor, 0, 0)
    draw_actor_hp(@actor, 0, 15)
    draw_actor_sp(@actor, 0, 30)
    draw_actor_exp(@actor, 0, 45)
  end
  def reset_variables
   @actor = $game_party.actors[0]
   @old_hp = @actor ? @actor.hp : 0
   @old_maxhp = @actor ? @actor.maxhp : 0
   @old_sp = @actor ? @actor.sp : 0
   @old_maxsp = @actor ? @actor.maxsp : 0
  end
  def update
    super
    refresh if (@actor = $game_party.actors[0] or
                @old_hp = @actor ? @actor.hp : 0 or
                @old_maxhp = @actor ? @actor.maxhp : 0 or
                @old_sp = @actor ? @actor.sp : 0 or
                @old_maxsp = @actor ? @actor.maxsp : 0)
  end
end
class Scene_Map
  alias yourhud_main main
  alias yourhud_update update
  def main
    @yourhud = Window_YourHUD.new
    yourhud_main
    @yourhud.dispose
  end
  def update
    @yourhud.update
    yourhud_update
  end
end

any help would be welcome, thanks
 

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