Difference between revisions of "P2D"

From Robowiki
Jump to navigation Jump to search
m (minor changes)
(Updated page)
Line 1: Line 1:
([[P2D/source|Source]])<br>
+
P2D, short for Point2D, is a helper class that makes drawing to the screen easier. This is taken from {{OldWiki|David_Alves/DrawingBot}} with some heavy modifications by [[User:Nat|Nat]]. It can currently draw Circles, Lines, Dots, and Text.
P2D, short for Point2D, is a helper class that makes drawing to the screen easier. This is taken from {{OldWiki|David_Alves/DrawingBot}} with some slight changes and syntax realignments currently.
 
  
 
==How to Use==
 
==How to Use==
Currently, this script helps draw Circles, Dots, Lines, and Text to the screen. To see these, you need to open your bot's debug console and click the 'Paint' button.
+
(A detailed description is needed)
 +
 
 
===Functions===
 
===Functions===
You can see more details on the functions on the [[P2D/API|API Page]].<br>
+
You can see more details on the functions on the [[P2D/API|API Page]]. The <code>color</code> variable is optional in all the listed functions. If it's not supplied, it'll default to <code>Color.WHITE</code>.
* <code>drawLine(Point2D.Double p1, Point2D.Double p2, Color color)</code><br>
+
* <code>P2D.drawLine(Point2D.Double p1, Point2D.Double p2, Color color)</code>
* <code>drawCircle(Point2D.Double center, double radius, Color color)</code><br>
+
* <code>P2D.drawCircle(Point2D.Double center, double radius, Color color)</code>
* <code>drawPoint(Point2D.Double p1, Color color)</code><br>
+
* <code>P2D.drawPoint(Point2D.Double p1, Color color)</code>
* <code>drawText(String text, double x, double y, Color color)</code>
+
* <code>P2D.drawText(String text, double x, double y, Color color)</code>
  
 
==Modifications==
 
==Modifications==
 
If you have any modifications to the script, like new features or the such, can be done on the [[P2D/source|Source Page]].
 
If you have any modifications to the script, like new features or the such, can be done on the [[P2D/source|Source Page]].

Revision as of 23:21, 25 May 2009

P2D, short for Point2D, is a helper class that makes drawing to the screen easier. This is taken from David_Alves/DrawingBot with some heavy modifications by Nat. It can currently draw Circles, Lines, Dots, and Text.

How to Use

(A detailed description is needed)

Functions

You can see more details on the functions on the API Page. The color variable is optional in all the listed functions. If it's not supplied, it'll default to Color.WHITE.

  • P2D.drawLine(Point2D.Double p1, Point2D.Double p2, Color color)
  • P2D.drawCircle(Point2D.Double center, double radius, Color color)
  • P2D.drawPoint(Point2D.Double p1, Color color)
  • P2D.drawText(String text, double x, double y, Color color)

Modifications

If you have any modifications to the script, like new features or the such, can be done on the Source Page.