P2D/API
< P2D
Jump to navigation
Jump to search
Contents
P2D API
drawLine(Point2D p1, Point2D p2, Color color);
- Draws a line on screen using the x/y coordinates, in pixels, supplied in
p1andp2.p1.xandp1.yare the starting x/y coordinates andp2.xandp2.yare the ending x/y coordinates. Thecolorvariable is optional, and if it isn't called, will default to usingColor.WHITE
drawCircle(Point2D center, double radius, Color color);
- Draws a circle with the the size specified by the radius variable with the center of the circle at the x/y coordinates, in pixels, supplied by the
centervariable. Thecolorvariable is optional, and if it isn't called, will default to usingColor.WHITE
drawPoint(Point2D p1, Color color);
- Draws a dot, or point, on screen using the x/y coordinates supplied in
p1. Thecolorvariable is optional, and if it isn't called, will default to usingColor.WHITE
drawText(String text, double x, double y, Color color);
- Renders the string supplied in the
textat the x/y coordinates supplied in thexandyvariables. Thecolorvariable is optional, and if it isn't called, will default to usingColor.WHITE