EasyManua.ls Logo

Commodore 128 - Drawing a Box - the BOX Command; Drawing Lines Points and Other Shapes-The DRAW Command

Commodore 128
448 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Drawing a Box The BOX Command
Now try a box. To draw a box, type:
80 BOX1,20,60,100,140,0,1
This draws a solid box to the left of the circle. To find out what the
numbers in the box statement mean, consult Chapter V, BASIC
7.0 Encyclopaedia. The BOX statement has seven parameters
you can select and modify to produce different types of boxes.
Change the foreground color and draw the outline of a box to the
right of the CIRCLE with these statements:
90 COLOR1,9:REM CHANGE FOREGROUND COLOR
100 BOX1,220,60,300,140,0,0
Experiment with the BOX statement to produce different
variations of rectangles and boxes.
Drawing Lines Points and Other ShapesThe DRAW
Command
You now know how to select graphic modes and colors and how
to display circles and boxes on the screen. Another graphics
statement, DRAW, lets you draw lines on the screen just as you
would with a pencil and a piece of paper. The following statement
draws a line below the boxes and circle.
120 DRAW 1,20,180 TO 300,180
To erase a drawn line, change the source (1) in the DRAW
statement to 0. The line is drawn with the background color which
actually erases the line. Try using different coordinates and other
sources to become accustomed to the DRAW statement.
The DRAW statement can take another form that allows you to
DRAW a line, change direction and then DRAW another line, so
the lines are continuous. For example, try this statement:
130 DRAW 1,250,0 TO 30,0 TO 40,40 TO 250,0
This statement DRAWs a triangle on the top of the screen. The
four pairs of numbers represent the X and Y coordinates for the
three points of the triangles. Notice the first and last coordinates
are the same, since you must finish drawing the triangle on the
same point you started. This form of draw statement gives you
the power to DRAW almost any geometric shape, such as
trapezoids, parallelograms and polygons.
6-10

Table of Contents

Other manuals for Commodore 128

Related product manuals