加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 冰水金刚 于 2014-7-19 09:02 编辑
血条定义(Window_Help中)
def set_enemy(enemy) @hp = nil @sp = nil @hp_a = nil @sp_a = nil @hp = Sprite.new @hp_a = Sprite.new @sp = Sprite.new @sp_a = Sprite.new @hp.bitmap = Bitmap.new(130,5) @hp_a.bitmap= Bitmap.new(130,5) @sp.bitmap = Bitmap.new(130,5) @sp_a.bitmap = Bitmap.new(130,5) color1 = Color.new(150,150,150,255) color2 = Color.new(255,100,100,255) color3 = Color.new(100,100,255,255) @hp.x = 60 @hp.y = 50 @hp.z = 10000 @hp.bitmap.fill_rect(0,0,120,32,color1) @sp.x = 450 @sp.y = 50 @sp.z = 10000 @sp.bitmap.fill_rect(0,0,120,32,color1) @hpa = 120*enemy.hp/enemy.maxhp @spa = 120*enemy.sp/enemy.maxsp @hp_a.x = 60 @hp_a.y = 50 @hp_a.z = 10000 @hp_a.bitmap.fill_rect(0,0,@hpa,32,color2) @sp_a.x = 450 @sp_a.y = 50 @sp_a.z = 10000 @sp_a.bitmap.fill_rect(0,0,@spa,32,color3) end
def set_enemy(enemy)
@hp = nil
@sp = nil
@hp_a = nil
@sp_a = nil
@hp = Sprite.new
@hp_a = Sprite.new
@sp = Sprite.new
@sp_a = Sprite.new
@hp.bitmap = Bitmap.new(130,5)
@hp_a.bitmap= Bitmap.new(130,5)
@sp.bitmap = Bitmap.new(130,5)
@sp_a.bitmap = Bitmap.new(130,5)
color1 = Color.new(150,150,150,255)
color2 = Color.new(255,100,100,255)
color3 = Color.new(100,100,255,255)
@hp.x = 60
@hp.y = 50
@hp.z = 10000
@hp.bitmap.fill_rect(0,0,120,32,color1)
@sp.x = 450
@sp.y = 50
@sp.z = 10000
@sp.bitmap.fill_rect(0,0,120,32,color1)
@hpa = 120*enemy.hp/enemy.maxhp
@spa = 120*enemy.sp/enemy.maxsp
@hp_a.x = 60
@hp_a.y = 50
@hp_a.z = 10000
@hp_a.bitmap.fill_rect(0,0,@hpa,32,color2)
@sp_a.x = 450
@sp_a.y = 50
@sp_a.z = 10000
@sp_a.bitmap.fill_rect(0,0,@spa,32,color3)
end
释放(Window_Help中)
def disposea if @hp != nil @hp.bitmap.dispose @hp.dispose @hp_a.bitmap.dispose @hp_a.dispose @sp.bitmap.dispose @sp.dispose @sp_a.bitmap.dispose @sp_a.dispose @hp = nil @sp = nil @hp_a = nil @sp_a = nil end end
def disposea
if @hp != nil
@hp.bitmap.dispose
@hp.dispose
@hp_a.bitmap.dispose
@hp_a.dispose
@sp.bitmap.dispose
@sp.dispose
@sp_a.bitmap.dispose
@sp_a.dispose
@hp = nil
@sp = nil
@hp_a = nil
@sp_a = nil
end
end
Scene_Battle中每个设置帮助窗口不可见的地方我都调用了disposea,但实际战斗时帮助窗口瞬间消失时血条总要等一段时间才消失,而不是同时消失,怎么让他们同时消失 |