Draw

The Draw command can draw lines, circles, rectangles and squares on the display window.

The appearance of the shapes (stroke colour, stroke thickness and fill colour) can be set with the Use command.

Understanding coordinates

Coordinates are specified as a pair of numbers separated by a comma. The first number, X, is the horizontal offset in pixels from the origin, while the second number, Y, is the vertical offset in pixels from the origin.

The drawing below shows the display window’s coordinate system. At the centre is the origin, where X and Y are both 0.

The display window coordinate system

The maximum and minimum values of X and Y at which shapes drawn will be visible will depend on your PC monitor’s screen resolution, but drawing shapes at off-screen coordinates is allowed.

Drawing lines

In this example a line is drawn from -100, 0 to 100, 0:

Draw Line From -100, 0 To 100, 0

Displaying a line

You can also refer to coordinates stored in previously defined variables:

Draw Line From X1, Y1 To X2, Y2

Drawing circles

In this example a circle with a Radius of 25 pixels is drawn at -100, 0:

Draw Circle With 25 Pixels Radius At -100, 0

Displaying a circle

You can also refer to radii or coordinates stored in previously defined variables:

Draw Circle With Radius Pixels Radius At X, Y

Drawing rectangles and squares

In this example a rectangle with a Width and Height of 50 pixels is drawn at 100, 0:

Draw Rectangle 50 Pixels Wide And 50 Pixels High At 100, 0

Displaying a rectangle

You can also refer to dimensions or coordinates stored in previously defined variables:

Draw Rectangle Width Pixels Wide And Height Pixels High At X, Y

Centring shapes

Circles and rectangles can be centred on their coodinates by adding the Centred command, as shown in this example:

Draw Circle With 25 Pixels Radius Centred At -100, 0
Draw Rectangle 50 Pixels Wide And 50 Pixels High Centred At 100, 0

Centring display items