#include <iostream>
#include <fstream>
◆ drawCircle()
Draws a circle where the pen currently is with radius r
filled with whatever color is currently set.
Example: drawCircle(10);
will draw a circle with radius 10 with an origin wherever the pen is.
- Parameters
-
r | The radius of the circle to draw. |
◆ drawRectangle()
void drawRectangle |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
Draws a rectangle with the upper left corner where the pen currently is with the given height and width and filled with whatever color is currently set.
Example: drawRectangle(2, 5);
will draw a rectangle with width 2 and height 5.
- Parameters
-
width | The width of the rectangle to draw. |
height | The height of the rectangle to draw. |
◆ end()
Indicates the end of your drawing. Call it like this: end();
◆ go()
Moves the pen's position to the given coordinate.
Example: go(10, 5);
will cause the pen's position to change to the (x,y) coordinate (10,5). Note that (0,0) is the upper left of the screen (so y increases the further down the screen you move).
- Parameters
-
x | The x coordinate to move to. |
y | The y coordinate to move to. |
◆ setColor()
void setColor |
( |
string |
color | ) |
|
Sets the fill color. Call this before drawing a shape to fill it with this color.
Example: setColor("#555555");
will set the color to #555555 (dark gray).
- Parameters
-
color | The hexadecimal color code to set. |
◆ start()
Indicates the start of your drawing. Call it like this: start();