赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 83 |
最后登录 | 2012-4-21 |
在线时间 | 13 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 13 小时
- 注册时间
- 2007-6-13
- 帖子
- 458
|
在里面增加个角色1的脚本
在网吧没RPG MAKER所以我不能测试
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
actor = $game_actors[1]#######################角色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 = 1 * 23
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, "HP", 0)
self.contents.font.color = normal_color
self.contents.draw_text(x-40, y+40, 160, 32, $game_actors[5].hp.to_s, 2)
self.contents.draw_text(x-40 + 23, y+40, 160, 32, $game_actors[1].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
actor = $game_actors[1]#######################角色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 |
|