ggdre 0 Posted January 24, 2023 EDIT: Solved by enabling script paint in menu... someone please delete this to hide my shame I'll start off by saying I'm completely new to programming with DreamBot and Java as a whole. Tried writing my first DB script today (a simple banking woodcutter) but can't for the life of me get onPaint() to paint my strings. I've ready many of the (really great) guides on this forum and still can't get it to work. I know I must be missing something simple - here is my code: private Timer timer; @Override public void onPaint(Graphics graphics) { Graphics2D g = (Graphics2D)graphics; // Have tried both with and without casting to Graphics2D g.setColor(Color.GREEN); g.setFont(new Font("Arial",Font.PLAIN,12)); g.drawString("XP/hour: " + SkillTracker.getGainedExperiencePerHour(Skill.WOODCUTTING),15,15); g.drawString("Total XP: " + SkillTracker.getGainedExperience(Skill.WOODCUTTING),15,35); g.drawString("Running for: " + timer,15,55); super.onPaint(g); // Have also tried with and without with no luck } I'm not calling onPaint() on paint anywhere else, which is my first thought as someone familiar with Python. Please help if you know how!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.