Code: |
def draw_hp_bar(x, y, level, small = false) src_rect = Rect.new(0, 0, 198, 24) bitmap = RPG::Cache.picture("hpbar.png") if small bitmap = RPG::Cache.picture("hpbarsmall.png") end self.contents.blt(x, y, bitmap, src_rect, 255) rect1 = Rect.new(x + 45, y + 6, level*144.to_i, 3) rect2 = Rect.new(x + 45, y + 9, level*144.to_i, 6) if small rect1 = Rect.new(x + 45, y + 6, level*129.to_i, 3) rect2 = Rect.new(x + 45, y + 9, level*129.to_i, 6) end if level < 0.1 color1 = Color.new(170, 70, 70, 255) color2 = Color.new(250, 90, 60, 255) elsif level >= 0.1 and level < 0.5 color1 = Color.new(200, 170, 0, 255) color2 = Color.new(250, 225, 50, 255) else color1 = Color.new(90, 210, 125, 255) color2 = Color.new(110, 250, 170, 255) end self.contents.fill_rect(rect1, color1) self.contents.fill_rect(rect2, color2) end def draw_exp_bar(x, y, level, width) rect1 = Rect.new(x, y, level*192.to_i, 6) self.contents.fill_rect(rect1, Color.new(160, 160, 255, 255)) end |
Code: |
def draw_hp_bar(x, y, level, small = false) src_rect = Rect.new(0, 0, 198, 24) bitmap = RPG::Cache.picture("hpbar.png") if small bitmap = RPG::Cache.picture("hpbarsmall.png") end self.contents.blt(x, y, bitmap, src_rect, 255) rect1 = Rect.new(x + 42, y + 4, level*144.to_i, 9) if small rect1 = Rect.new(x + 42, y + 4, level*129.to_i, 9) end if level < 0.1 color1 = Color.new(248, 64, 16, 255) elsif level >= 0.1 and level < 0.5 color1 = Color.new(232, 168, 50, 255) else color1 = Color.new(24, 192, 32, 255) end self.contents.fill_rect(rect1, color1) end def draw_exp_bar(x, y, level, width) rect1 = Rect.new(x, y, level*232.to_i, 6) self.contents.fill_rect(rect1, Color.new(64, 144, 224, 255)) end |
Code: |
def draw_hp_bar(x, y, level, small = false) src_rect = Rect.new(0, 0, 198, 24) bitmap = RPG::Cache.picture("hpbar.png") if small bitmap = RPG::Cache.picture("hpbarsmall.png") end self.contents.blt(x, y, bitmap, src_rect, 255) rect1 = Rect.new(x + 45, y + 6, level*144.to_i, 9) if small rect1 = Rect.new(x + 45, y + 6, level*129.to_i, 9) end if level < 0.1 color1 = Color.new(248, 64, 16, 255) elsif level >= 0.1 and level < 0.5 color1 = Color.new(232, 168, 50, 255) else color1 = Color.new(24, 192, 32, 255) end self.contents.fill_rect(rect1, color1) end def draw_exp_bar(x, y, level, width) rect1 = Rect.new(x, y, level*192.to_i, 6) self.contents.fill_rect(rect1, Color.new(64, 144, 224, 255)) end |
Warp' a écrit: |
Plus personne a ce script en ligne, même moi. |