赞 | 0 |
VIP | 157 |
好人卡 | 6 |
积分 | 1 |
经验 | 113829 |
最后登录 | 2014-1-16 |
在线时间 | 26 小时 |
Lv1.梦旅人 B
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 26 小时
- 注册时间
- 2007-8-26
- 帖子
- 3693
|
class Window_HUD < Window_Base
def initialize
super(200,0,200,480)#########################窗口位置、大小
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 20
refresh
end
def refresh
self.contents.clear
self.opacity = 0############################窗口透明度
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 = 96
draw_actor_name(actor,x,y)
draw_actor_class(actor,x,y + 20)
#############################################################################
self.contents.font.color = system_color
self.contents.draw_text(x, y+40, 120-10-2, 32, "HP", 0)
self.contents.font.color = normal_color
self.contents.draw_text(x, 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
SWITCH_ID = 1 ############################开关,打开时不显示窗口
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[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 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|