I want to make a rectangle with the polygon class. I know you can use the rectangle class, but it needs to be made under the polygon class. How can i set paramters to initalize a rectangle. Im using javafx.
Polygon polygon = new Polygon();
//Adding coordinates to the polygon
polygon.getPoints().addAll(new Double[]{
200.0, 50.0,
400.0, 50.0,
450.0, 250.0,
400.0, 250.0,
100.0, 250.0,
100.0, 150.0,
});
i started with this just as a template, but it makes a pentagon.