赞 | 403 |
VIP | 0 |
好人卡 | 11 |
积分 | 399 |
经验 | 242285 |
最后登录 | 2025-7-26 |
在线时间 | 5802 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 39930
- 在线时间
- 5802 小时
- 注册时间
- 2006-11-10
- 帖子
- 6678
|
#描画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
用这段替换掉最前面那段试试
----分割分割---------
-。-楼上的方法好,简单得多。 |
|