[XP]-Hud HP Mp Down of Hero-[Aporte]

OP

~Doku

Banneado
Mensajes
1.024
Reacciones
0
Puntos
0
Ubicación
Mafia
Otra HUD mas xDD

Autor:

LukyMaster

Explicación:

Esta HUD muestra el HP y MP bajo el personaje usando barras que se pueden personalizar.

Imagen:

screeniy.jpg


Script:

Código:
module Luky
  HUD_OPACITY = 0
  HUD_OPACITY_2 = 255

end


class Mini_Hud < Window_Base
  include Luky
  def initialize
      super($game_player.screen_x-60,$game_player.screen_y-78,120,120)
      self.contents = Bitmap.new(width - 32, height - 32)
      refresh
    end
   
  def refresh
   self.contents.clear
    self.contents.font.size = 15
    self.contents.font.name = "Arial"
    actor = $game_party.actors[0]
    draw_actor_name(actor, 18, -8)
    self.opacity = Luky::HUD_OPACITY

    self.contents_opacity = Luky::HUD_OPACITY_2
    self.x =  $game_player.screen_x - 60
    self.y =  $game_player.screen_y - 78
    fd = RPG::Cache.picture("Back_Bar")
    bw = fd.width
    bh = fd.height
    fd_rect = Rect.new(0,0,bw,bh)
    self.contents.blt(18,55,fd,fd_rect)
    barhp = RPG::Cache.picture("Hp_Bar")
    bhw = barhp.width * actor.hp / actor.maxhp
    bhh = barhp.height
    barhp_rect = Rect.new(0,0,bhw,bhh)
    self.contents.blt(18,55,barhp,barhp_rect)
    fd2 = RPG::Cache.picture("Back_Bar")
    bw2 = fd.width
    bh2 = fd.height
    fd_rect2 = Rect.new(0,0,bw2,bh2)
    self.contents.blt(18,64,fd2,fd_rect2)
    barmp = RPG::Cache.picture("Mp_Bar")
    bsw = barmp.width * actor.sp / actor.maxsp
    bsh = barmp.height
    barmp_rect = Rect.new(0,0,bsw,bsh)
    self.contents.blt(18,64,barmp,barmp_rect)
  end
end



class Scene_Map
  alias hud_main main
  def main
      @Mini_Hud = Mini_Hud.new
      hud_main
    @Mini_Hud.dispose if @d != true
  end
 
  alias hud_update update
  def update
    hud_update
    @Mini_Hud.x = $game_player.screen_x-60
    @Mini_Hud.y = $game_player.screen_y-78
    @Mini_Hud.refresh
    @Mini_Hud_update
  end
end

Imágenes necesarias:

backqc.png

hpbar.png

mpbar.png


Deberán ir en la carpeta pictures de su proyecto.

Espero que les guste :D

Saludos.
 
Arriba Pie