Jump to content

[HELP] Display counter on GUI screen..


Recommended Posts

Posted (edited)

Use the onPaint() method in the script class

e.g


public void onPaint(Graphics2D g) {    
    if(image != null){          
         g.drawImage(image, 545, 139, null);
    }
    g.drawString(formatTime(timer.getElapsed()), 388, 277); //395
    g.drawString("Hides: " + hides, 388, 289);
    if(buryBones || keepBones)g.drawString("Bones: " + bones, 388, 301);
}

Graphis2D api https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html

Edited by Qubit
  • Like 1
Posted

last qustion for today , what methoed used to place a counter on client screen ?

lets say counter for how many bones the script already collected or feathers or what ever i want  ?

int bones;

if condition
   bones++;



//onPaint
g2d.drawString("Bones: " + bones, x position, y position);
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...