| 赞 | 0 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 1 |
| 经验 | 2574 |
| 最后登录 | 2016-10-9 |
| 在线时间 | 12 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 12 小时
- 注册时间
- 2007-8-1
- 帖子
- 243
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
这是Window_BattleStatus里的内容,我添了战斗头像在里面:
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 9999#小改动
self.opacity = 0#小改动
@level_up_flags = [false, false, false, false]
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
HP(actor,actor_x,32)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
x = i * 150
testname = actor.id.to_s + "_f"
bitmap=Bitmap.new("Graphics/pictures/#{testname}")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, 0, bitmap, src_rect)
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
end
这是我跟教程录象后做出来的HP血框,我把他插在了Window_BattleStatus上面:
#--------------------------------------------------------------------------
#●自制HP
#--------------------------------------------------------------------------
def HP(actor,x,y)
@bitmap1=Bitmap.new("Graphics/pictures/HP1")
@src_rect1 = Rect.new(0, 0, @bitmap1.width, @bitmap1.height)
self.contents.blt(x+32, y+32, @bitmap1, @src_rect1)
end
结果血框却显示在战斗头像的后面,要不是头像透明度低的话,还真看不见血框,请各位高手指点一下,怎样血条显示在战斗头像的前面。[PS:我战斗系统用的是全动画战斗脚本] |
|