class Window_HUD < Window_Base
def initialize
super(300,100,200,200)#########################窗口位置、大小
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.contents.font.size = 20
refresh
end
def refresh
self.contents.clear
self.opacity = 150############################窗口透明度
actor = $game_actors[5]#######################角色ID
bitmap=Bitmap.new("Graphics/battlers/#{actor.battler_name}")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
x = 0
y = 23
draw_actor_name(actor,x,y)
draw_actor_class(actor,x,y + 0)
#############################################################################
self.contents.font.color = system_color
self.contents.draw_text(x, y+40, 120-10-2, 32, "生命", 96)
self.contents.font.color = normal_color
self.contents.draw_text(x-40, y+40, 160, 32, $game_actors[5].hp.to_s, 2)
#draw_actor_hp(actor,x,y + 40)
#############################################################################
for i in 4..5
draw_actor_parameter(actor,x, y + 20 *( i - 1),i-1)
end
$hudtemp = [actor.hp,actor.str,actor.dex,actor.class_id]
end
end
class Scene_Map
Window_HUD_SWITCH_ID = 150 ############################开关,打开时显示窗口
alias raz_hud_main main
alias raz_hud_update update
def main
@hud_window = Window_HUD.new
raz_hud_main
@hud_window.dispose
end
def update
@hud_window.visible = $game_switches[Window_HUD_SWITCH_ID] ? true : false
actor = $game_actors[5]#######################角色ID
maptemp = [actor.hp,actor.str,actor.dex,actor.class_id]
for i in 4..5
if $hudtemp != maptemp then
@hud_window.refresh
@hud_window.update
end
end
raz_hud_update
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |