Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //author flaetch_to_99
- private void drawProgressBar(final Graphics2D g, final int skill,
- final int x, final int y, final int width, final int height,
- final Color colorBase, final Color colorOver,
- final Color textColor, final int alpha) {
- final GradientPaint base = new GradientPaint(x, y, new Color(200, 200,
- 200, alpha), x, y + height + 3, colorBase);
- final GradientPaint overlay = new GradientPaint(x, y, new Color(200,
- 200, 200, alpha), x, y + height + 3, colorOver);
- g.setStroke(new BasicStroke(1));
- g.setPaint(base);
- g.fillRect(x, y, width, height);
- g.setPaint(overlay);
- g.fillRect(x, y,
- (int) (width * Skills.getPercentToNextLevel(skill) / 100.0),
- height);
- g.setColor(Color.BLACK);
- g.drawRect(x, y, width, height);
- g.setFont(new Font("Arial", 1, (width / 35 + height / 5)));
- final String progress = Skills.getPercentToNextLevel(skill) + "% to "
- + (Skills.getCurrentLevel(skill) + 1) + " "
- + Skills.SKILL_NAMES[skill] + " | "
- + Skills.getExpToNextLevel(skill) + " XP Until level";
- g.setColor(new Color(textColor.getRed(), textColor.getGreen(),
- textColor.getBlue(), 150));
- g
- .drawString(
- progress,
- x + (width - g.getFontMetrics().stringWidth(progress))
- / 2,
- (int) (y + (g.getFontMetrics().getHeight() / 2 + height / 4 * 1.65)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement