-
Notifications
You must be signed in to change notification settings - Fork 11
Learn: Draw Shapes
Evy has many commands that can be used to make drawings. We will start by creating shapes with move
, line
, rect
, and circle
.
The move
command sets the position of the drawing pen, and the line
command draws a line from the current position of the pen to the specified coordinates. For example:
move 20 40 line 50 50 |
We use the move
command to set the pen to position 20 40
. Then, we use the line
command to draw a line to position 50 50
.
Note, this and all following images are created with evy code.
The line
command draws a line from the current position of the pen to the specified coordinates. The current position of the pen is updated to new coordinates. Here is an example of how to draw a triangle.
move 20 40 line 50 80 line 80 40 line 20 40 |
The rect
command draws a rectangle with the given width and height at the pen's current position. If the pen is currently at position 50 50
, and you type rect 10 20
, the program will draw a rectangle with width 10
and height 20
, and then move the pen to position 60 70
.
move 50 50 rect 10 20 rect 30 10 |
The circle
command draws a circle with the given radius. The center of the circle is the pen's current position, and the pen does not move.
For example, if the pen is currently at position 50 50
, and you type circle 10
, the program will draw a circle with radius 10, centered at position 50 50
. The pen will still be at position 50 50
after the circle is drawn.
move 50 50 circle 10 |
-
move x y
sets the position of the drawing pen. -
line x y
draws a line from the current position of the pen to the specified coordinatesx y
. -
rect w h
draws a rectangle with the specified widthw
and heighth
. -
circle r
draws a circle at the current position of the pen with the given radiusr
.
Overview | About | Playground | Gallery