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

    Posted

    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.

    Posted

    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

    Posted

    What Articron said would probably works, though why would you want to do this? And I'd imagine that it could be quite resource hungry.

    Posted
    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.

    Posted

    Just got home to try and see if it would work and I can definitely say thank you guys, it works like a charm.

    Posted
    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

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