Jump to content

Help drawing Area for debuggin purposes


Recommended Posts

Posted

I can't figure out how to draw the area for debuging purposes.

I've tried g.drawRectangel(int x,int y, width,height) 

g.fillRectangle

I just can't seem to understand how to use the function 

 

@Override
public void onPaint(Graphics2D g) {

  
}

PS To create areas do i read the position (x and y) or the gridpos. (x and y). Also why does the getWalking().walk(Area) does not function? 

Posted (edited)
On 8/23/2021 at 12:37 PM, Shunoo said:

I can't figure out how to draw the area for debuging purposes.

I've tried g.drawRectangel(int x,int y, width,height) 

g.fillRectangle

I just can't seem to understand how to use the function 

 

@Override
public void onPaint(Graphics2D g) {

  
}

PS To create areas do i read the position (x and y) or the gridpos. (x and y). Also why does the getWalking().walk(Area) does not function? 

Easiest way to draw areas is by using the position list.

area.getPositions().forEach(pos -> {
	if (pos != null && pos.isVisible())
        g.draw(p.getPolygon());
});

 

Edited by Chris

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