Difference between revisions of "P2D/API"

From Robowiki
< P2D
Jump to navigation Jump to search
(Partial API (Need to complete in the morning)
 
(→‎P2D API: Finished API)
 
Line 1: Line 1:
 
=P2D API=
 
=P2D API=
==drawLine(Point2D.Double p1, Point2D.Double p2, Color color);==
+
==drawLine(Point2D p1, Point2D p2, Color color);==
:''Draws a line using the x and y coordinates, in pixels, supplied in <code>p1</code> and <code>p2</code>. <code>p1.x</code> and <code>p1.y</code> are the starting x/y coordinates and <code>p2.x</code> and <code>p2.y</code> are the ending x/y coordinates.''
+
:''Draws a line on screen using the x/y coordinates, in pixels, supplied in <code>p1</code> and <code>p2</code>. <code>p1.x</code> and <code>p1.y</code> are the starting x/y coordinates and <code>p2.x</code> and <code>p2.y</code> are the ending x/y coordinates. The <code>color</code> variable is optional, and if it isn't called, will default to using <code>Color.WHITE</code>''
==drawCircle(Point2D.Double center, double radius, Color color);==
+
==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 supplied by the center variable.''
+
:''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 <code>center</code> variable. The <code>color</code> variable is optional, and if it isn't called, will default to using <code>Color.WHITE</code>''
 +
==drawPoint(Point2D p1, Color color);==
 +
:''Draws a dot, or point, on screen using the x/y coordinates supplied in <code>p1</code>. The <code>color</code> variable is optional, and if it isn't called, will default to using <code>Color.WHITE</code>''
 +
==drawText(String text, double x, double y, Color color);==
 +
:''Renders the string supplied in the <code>text</code> at the x/y coordinates supplied in the <code>x</code> and <code>y</code> variables. The <code>color</code> variable is optional, and if it isn't called, will default to using <code>Color.WHITE</code>''

Latest revision as of 18:17, 25 May 2009

P2D API

drawLine(Point2D p1, Point2D p2, Color color);

Draws a line on screen using the x/y coordinates, in pixels, supplied in p1 and p2. p1.x and p1.y are the starting x/y coordinates and p2.x and p2.y are the ending x/y coordinates. The color variable is optional, and if it isn't called, will default to using Color.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 center variable. The color variable is optional, and if it isn't called, will default to using Color.WHITE

drawPoint(Point2D p1, Color color);

Draws a dot, or point, on screen using the x/y coordinates supplied in p1. The color variable is optional, and if it isn't called, will default to using Color.WHITE

drawText(String text, double x, double y, Color color);

Renders the string supplied in the text at the x/y coordinates supplied in the x and y variables. The color variable is optional, and if it isn't called, will default to using Color.WHITE