- 注册时间
- 2009-11-5
- 最后登录
- 2010-1-8
③业余
- 积分
- 152
|
发表于 2010-1-14 08:59:57
|
显示全部楼层
自己弄得:
class Window_Help < Window_Base
def set_enemy(actor)
self.contents.clear
self.contents.font.size = 15
draw_actor_name(actor, 4, -5)
draw_actor_state(actor, 120, -5)
draw_slant_bar(actor, 320, -5)
@text = nil
self.visible = true
end
def draw_slant_bar(actor, x, y, width = 280)
self.contents.font.color = normal_color
self.contents.font.size = 15
self.contents.fill_rect(x-1, y+3, width+2,22, Color.new(0, 0, 0, 255))
w = width * actor.hp / actor.maxhp
case w
when 84..280
self.contents.fill_rect(x, y+5, w,20, Color.new(0, 255, 0, 255))
self.contents.fill_rect(x, y+6, w,16, Color.new(30, 255, 30, 255))
self.contents.fill_rect(x, y+8, w,12, Color.new(60, 255, 60, 255))
self.contents.fill_rect(x, y+10, w,8, Color.new(90, 255, 90, 255))
self.contents.fill_rect(x, y+12, w,4, Color.new(120, 255, 120, 255))
self.contents.fill_rect(x, y+12.5, w,2, Color.new(150, 255, 150, 255))
when 28..84
self.contents.fill_rect(x, y+5, w,20, Color.new(255, 255, 0, 255))
self.contents.fill_rect(x, y+6, w,16, Color.new(255, 255, 30, 255))
self.contents.fill_rect(x, y+8, w,12, Color.new(255, 255, 60, 255))
self.contents.fill_rect(x, y+10, w,8, Color.new(255, 255, 90, 255))
self.contents.fill_rect(x, y+12, w,4, Color.new(255, 255, 120, 255))
self.contents.fill_rect(x, y+12.5, w,2, Color.new(255, 255, 150, 255))
when 0..28
self.contents.fill_rect(x, y+5, w,20, Color.new(255, 0, 0, 255))
self.contents.fill_rect(x, y+6, w,16, Color.new(255, 30, 30, 255))
self.contents.fill_rect(x, y+8, w,12, Color.new(255, 60, 60, 255))
self.contents.fill_rect(x, y+10, w,8, Color.new(255, 90, 90, 255))
self.contents.fill_rect(x, y+12, w,4, Color.new(255, 120, 120, 255))
self.contents.fill_rect(x, y+12.5, w,2, Color.new(255, 150, 150, 255))
end
self.contents.draw_text(x + 70, y-2, 65, 32, actor.hp.to_s, 2)
self.contents.draw_text(x + 135, y-2, 10, 32, "/", 1)
self.contents.draw_text(x + 145, y-2, 65, 32, actor.maxhp.to_s)
self.contents.font.color = normal_color
end
end |
|