Athylus Posted May 9, 2018 Posted May 9, 2018 (edited) Hey all, currently debugging some Area code. Position[] possArr = {new Position(x1, y1, 1), new Position(x2, y2, 1) etc ...}; Area areaPoly = new Area(posArr); @Override public void onPaint(Graphics2D g) { List<Position> posList = areaPoly.getPositions(); g.setColor(Color.BLACK); boolean bool = areaPoly.contains(myPlayer()); g.drawString(Boolean.toString(bool), 10, 20); for (Position pos : posList) { g.draw(pos.getPolygon(getBot())); } } The area is being drawn but on the z=0 plane. My boolean displays true on the 0 plane, but false on same spot on the 1 plane. Any workarounds? Edited May 10, 2018 by Athylus
Stimpack Posted May 9, 2018 Posted May 9, 2018 show line where you initialize your Area Position[] areaPoly = {new Position(x1, y1, 1), new Position(x2, y2, 1) etc ...}; ^not this thingy by default, z coordinate is set to 0 have u tried areaPoly.setPlane(1) then painting it 1
Athylus Posted May 10, 2018 Author Posted May 10, 2018 Setplane is working, thanks! I thought that setting that Z coordinate would be enough. Great!