Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • A Pug Tutorial - All About Making The Best Paint


    Pug

    Recommended Posts

    public void onMouse(MouseEvent e)
    {
    p = e.getPoint();
    if (close.contains(p) && !hide) {
    hide = true;
    } else if (open.contains(p) && hide) {
    hide = false;
    }
    }
    

    can be changed to

    public void onMouse(MouseEvent e)
    {
      p = e.getPoint();
      if (close.contains(p)) {
         hide = !hide;
      }
    }
    

    for the same effect.

    Link to comment
    Share on other sites

    • 3 months later...
    • 3 weeks later...

    Hey Pug, for some reason I can't get a custom image to display on my game window. I've followed your example under the "adding a background" section.

     

    Here's what I have in my main class:

    private final Image bg = getImage(
    			"http://s7.postimg.org/ghg9yybiz/Jdv_Woodcutter.png");
    
    public void onPaint(Graphics g){
    		g.drawImage(bg, 100, 100, null);
    		timeTracker.onPaint(g);
    		logTracker.onPaint(g);
    		levelTracker.onPaint(g);
    	}
    
    private Image getImage(String url) {
    		try {
    			return ImageIO.read(new URL(url));
    		} catch (IOException e) {
    		}
    		return null;
    	}
    

    Are there any problems you can see with this that might be causing the image to not be displayed? Thanks.

    Link to comment
    Share on other sites

    • 2 months later...
    • 1 month later...
    • 3 years later...
    • 1 year later...

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.