January 5, 201610 yr Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get
January 5, 201610 yr Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get Use explv location assitant or Divine Utility.
January 5, 201610 yr Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get You can use "Explv's Location Assistant" in the Other section, and just copy-paste your path, it will show on screen.
January 6, 201610 yr Author No no i mean like when im using my own script i need onPaint method to draw my path to some kind of area or something like that
January 6, 201610 yr No no i mean like when im using my own script i need onPaint method to draw my path to some kind of area or something like that Do you mean a predefined path? Or colour all the tiles that your player walks to? Edited January 6, 201610 yr by Explv
January 6, 201610 yr Do you mean a predefined path? Or colour all the tiles that your player walks to? Colouring every tile that your player walks to: private final List<Position> WALKED_POSITIONS = new ArrayList<>(); @Override public void onPaint(Graphics2D g){ updateWalkedPositions(); drawWalkedPositions(g); } private void updateWalkedPositions(){ if(!WALKED_POSITIONS.contains(myPosition())) WALKED_POSITIONS.add(myPosition()); } private void drawWalkedPositions(Graphics2D g){ for(Position position : WALKED_POSITIONS) fillPositionOnScreen(position, g); } private void fillPositionOnScreen(Position position, Graphics2D g){ Polygon polygon = position.getPolygon(script.getBot()); g.fillPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); } Edited January 6, 201610 yr by Explv
January 6, 201610 yr You can can draw your own position then all you do is the same logic but use a for loop and just loop through your array of position and display them
Create an account or sign in to comment