赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 55044 |
最后登录 | 2022-1-4 |
在线时间 | 49 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 95
- 在线时间
- 49 小时
- 注册时间
- 2006-5-7
- 帖子
- 526
|
# 描绘 HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# 描绘 MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
这部分看到了吗?
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)和self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)就是描绘当前血和最大血量的
修改如下
- # 描绘 HP
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- if actor.maxhp>10000#最大血大于10000时
- self.contents.draw_text(hp_x, y, 48, 32, "????", 2)#描绘"????"
- else#否则
- self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
- end
- # 描绘 MaxHP
- if flag
- self.contents.font.color = normal_color
- self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
- if actor.maxhp>10000#同上........
- self.contents.draw_text(hp_x, y, 48, 32, "????", 2)
- else
- self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
- end
- end
复制代码 |
|