Loki
Preferowany:
Pomógł: 12 razy Dołączył: 25 Kwi 2012 Posty: 162
Wysłany: Sob 19 Maj, 2012 19:44
Hud HP Mp Down of Hero
~ Hud HP Mp Down of Hero ~
Autor:
LukyMaster
Kompatybilność:
RPG Maker XP
Skrypt:
Spoiler:
Kod: 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
Screeny:
Dodatkowe informacje:
Potrzebne grafiki:
http://img695.imageshack.us/img695/8039/backqc.png
http://img181.imageshack.us/img181/7471/hpbar.png
http://img20.imageshack.us/img20/1407/mpbar.png