赞 | 18 |
VIP | 94 |
好人卡 | 0 |
积分 | 111 |
经验 | 60791 |
最后登录 | 2022-2-2 |
在线时间 | 1155 小时 |
Lv4.逐梦者 ST戰士
- 梦石
- 11
- 星屑
- 82
- 在线时间
- 1155 小时
- 注册时间
- 2007-5-5
- 帖子
- 3489
|
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 + 64)
#############################################################################
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
应该是这样没错吧? 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|