c0nan Posted June 22, 2016 Posted June 22, 2016 (edited) Heyyo, I am trying to use the onPaint() method in my script but it is not showing up for some reason. @Override public void onPaint(Graphics2D g) { timeRan = System.currentTimeMillis() - this.timeBegan; g.drawString(ft(timeRan), 1, 1); currentXp = skills.getExperience(Skill.WOODCUTTING); xpGained = currentXp - beginningXp; g.drawString("" + xpGained, 1, 1); } Is there something wronge with that code? Thanks in advance BR c0nan Edited June 22, 2016 by c0nan
Vilius Posted June 22, 2016 Posted June 22, 2016 g.drawString("" + xpGained, 1, 1); The numbers in that code mean the x, y position of the paint, you need to change it to somethin like 1,15 to draw it correctly. Because it draws text from the bottom up. 1
c0nan Posted June 22, 2016 Author Posted June 22, 2016 g.drawString("" + xpGained, 1, 1); The numbers in that code mean the x, y position of the paint, you need to change it to somethin like 1,15 to draw it correctly. Because it draws text from the bottom up. Oh damn, haha Now I can see it , Thanks for you help!
Optimum Scripts Posted June 22, 2016 Posted June 22, 2016 Add these at the top: gd.setColor(Color.WHITE); gd.setFont(new Font("Arial", Font.PLAIN, 18));