DrawingTool Class Specifications
backward(distance);
- move backwards distance amount of spaces
- example:
down();
- put pencil down on paper
- example:
drawString(text);
- write text at current location
- example:
- pencil.drawString("My House");
drawCircle(radius);
- draw a circle at current location
- example:
forward(distance);
- move forward distance amount of spaces in current direction
- example:
home();
- move back to origin (0,0) with direction up
- example:
move(distance);
- same as forward
- be careful to confuse with move(x, y);
- example:
move(x, y);
- move to the point (x, y)
- will make a line if the marker is down.
- example:
setColor(Color);
- set the color to draw in
- you must have
import java.awt.Color; at the top of your java file
- example:
- pencil.setColor(Color.blue);
setWidth(width);
- set the width that the pencil draws in
- example:
turnLeft(degrees);
- change the direction of the marker by degrees to the left
- example:
turnRight(degrees);
- change the direction of the marker by degrees to the right
- example:
up();
- lift up the marker so you can move it without drawing
- example: