| 赞 | 14 |
| VIP | |
| 好人卡 | |
| 积分 | 6 |
| 经验 | |
| 最后登录 | 2026-8-9 |
| 在线时间 | 797 小时 |
- 梦石
- 0
- 星屑
- 606
- 在线时间
- 797 小时
- 注册时间
- 2014-7-1
- 回帖
- 501

|
楼主 |
发表于 2016-1-15 16:10:38
|
显示全部楼层
本帖最后由 jiushiainilip19 于 2016-1-15 16:16 编辑
自己弄好了 可惜大小方面不好弄 小了在观看上就不美观了
大了位置不够 算了 感谢各位指点
我是直接更改height的算法 :结果血量是从下往上减少!{:2_276:}
[pre lang="ruby"]
#--------------------------------------------------------------------------
# ●描绘 HP
#--------------------------------------------------------------------------
def draw_actor_hp_bar(actor, x, y, width = 144 , height = 68)
#描绘HP字符
self.contents.font.size = 18
self.contents.draw_text(x-25, y+76, 70, 32,actor.hp.to_s, 2)
self.contents.draw_text(x-10, y+76, 70, 32, "体:")
#描绘HP
self.contents.fill_rect(x+2, y+2, width,height, Color.new(0,0,0,255))
w1 = 1.0 * actor.hp / actor.maxhp * height
self.contents.fill_rect(x+2, y+2, width,w1, Color.new(255,0,0,255))
end
[/pre] |
|