Project1

标题: 人物死亡时血槽自动消失 [打印本页]

作者: 扬扬    时间: 2008-8-9 05:56
提示: 作者被禁止或删除 内容自动屏蔽
作者: dbshy    时间: 2008-8-9 06:18
alias xrxs_bp2_refresh refresh
def refresh
   xrxs_bp2_refresh
   @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
     actor = $game_party.actors
     case i
       when 0
        x = 310
        y = 390
       when 1
        x = 390
        y = 340
       when 2
        x = 480
        y = 300
       when 3
        x = 550
        y = 270
      end

   if !actor.dead? then
     HP(actor, x-10, y)
     SP(actor, x-10, y + 10)
   end

   end

[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 灯笼菜刀王    时间: 2008-8-9 06:21
#描画HP槽
def HP (actor,x,y)         
@bitmap3 = Bitmap.new("Graphics/Pictures/底")
@src_rect3 = Rect.new(0,0,@bitmap3.width, @bitmap3.height)
self.contents.blt(x,y, @bitmap3, @src_rect3)
if actor.hp == 0
self.opacity = 0
else
self.opacity = 255
end
#HP显示
@bitmap3 = Bitmap.new("Graphics/Pictures/hp")
w3 = @bitmap3.width * actor.hp/actor.maxhp
@src_rect3 = Rect.new(0,0,w3, @bitmap3.height)
self.contents.blt(x+4,y+2, @bitmap3, @src_rect3)
if actor.hp == 0
self.opacity = 0
else
self.opacity = 255
end
end
#描画SP槽
def SP (actor,x,y)
@bitmap1 = Bitmap.new("Graphics/Pictures/底")
@src_rect1 = Rect.new(0,0,@bitmap1.width, @bitmap1.height)
self.contents.blt(x,y, @bitmap1, @src_rect1)
if actor.hp == 0
self.opacity = 0
else
self.opacity = 255
end
#SP显示           
@bitmap1 = Bitmap.new("Graphics/Pictures/sp")
w1 = @bitmap1.width * actor.sp/actor.maxsp
@src_rect1 = Rect.new(0,0,w1, @bitmap1.height)
self.contents.blt(x+4,y+2, @bitmap1, @src_rect1)
if actor.hp == 0
self.opacity = 0
else
self.opacity = 255
end
end


用这段替换掉最前面那段试试

----分割分割---------
-。-楼上的方法好,简单得多。
作者: 扬扬    时间: 2008-8-9 17:17
提示: 作者被禁止或删除 内容自动屏蔽
作者: 扬扬    时间: 2008-8-11 19:54
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1