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
  • How to draw an Area?


    FilthE

    Recommended Posts

    So if I define an Area with

            myLocation = getLocalPlayer().getTile();
            myArea = Area.generateArea(x, myLocation);
    

    then try to draw it with

            g.drawPolygon(myArea.getPolygonArea());
    

    I get nothing at all. I can draw the myLocation tile just fine but I really need the area around that tile.

    Link to comment
    Share on other sites

    Drawing an area (or multiple things at a time) is generally a problem with Dreambot 

     

    What you can try is to loop through all tiles of that Area (Area#getTiles) and draw the polygons individually

    Link to comment
    Share on other sites

    if (getMap().isTileOnMap(The nearest tile to your area)) {
      for (Tile t : yourArea.getTiles()) {
        *your paint graphics var here*.drawPolygon(getMap().getPolygon(t));
      }
    }
    
    

    Can confirm arti's solution works.

    Link to comment
    Share on other sites

    if (getMap().isTileOnMap(The nearest tile to your area)) {
      for (Tile t : yourArea.getTiles()) {
        *your paint graphics var here*.drawPolygon(getMap().getPolygon(t));
      }
    }
    
    

    Can confirm arti's solution works.

     

     

    OFC IT WORKS

     

    I'M ME

    Link to comment
    Share on other sites

    • 1 month 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.