Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- EXP Bar Fix for Falcao's ABS
- Made by: Sixth
- What is fixed:
- - The displayed XP bar did not show the correct values.
- - The XP bar could get out of scope (over max limit) after the player reaches
- the maximum level.
- Installation:
- - Put this script below the Falcao's ABS scripts!
- =end
- module PearlKernel
- def self.draw_gauge(obj, nm, max, x, y, w, h, col, tag, name)
- obj.font.shadow = true
- w2 = w - 2 ; max = 1 if max == 0
- obj.fill_rect(x, y - 1, w, h + 2, @gaugeback)
- obj.fill_rect(x+1, y+1, w2*[nm.to_f/max,1].min, h/2 - 1, col[0])
- obj.fill_rect(x+1, y + h/2, w2*[nm.to_f/max,1].min, h/2 - 1, col[1])
- txt = tag == 'Exp' && nm.to_f / max > 1 ? "-------" : nm.to_s+"/"+max.to_s
- obj.draw_text(x, y + h - 22, w, 32, txt, 2)
- obj.draw_text(x + 4, y + h - 22, w, 32, tag)
- obj.draw_text(x, y - 25, w, 32, name, 1) if !name.nil?
- end
- def self.draw_i_gauge(bitmap, x, y, back, image, nm, max, tag, name)
- cw = back.width
- ch = back.height
- max = 1 if max == 0
- src_rect = Rect.new(0, 0, cw, ch)
- bitmap.blt(x - 10, y - ch + 30, back, src_rect)
- cw = image.width * [nm.to_f / max, 1].min
- ch = image.height
- src_rect = Rect.new(0, 0, cw, ch)
- txt = tag == 'Exp' && nm.to_f / max > 1 ? "-------" : nm.to_s+"/"+max.to_s
- bitmap.blt(x - 10, y - ch + 30, image, src_rect)
- bitmap.draw_text(x - 4, y + back.height - 14, back.width, 32, tag)
- bitmap.draw_text(x - 12, y + back.height - 14, back.width, 32, txt, 2)
- bitmap.draw_text(x - 6, y - 10, back.width, 32, name, 1) if !name.nil?
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement