The Graphics Cursor And Drawing Lines - AMSTRAD CPC464 User Manual

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

52.5 The graphics cursor and drawing lines

You have now tried some of the ways you can translate programs into graphic displays - and several
of the program commands and concepts have been given a chance to perform. When drawing lines at
the screen, there are some important considerations to watch out for to avoid confusion.
The first point to watch for is the current state of the program memory. The computer remembers
the current colour settings even after a NEW instruction to clear the program memory. To reset
everything to the starting point, you should use the simultaneous [CTRL][SHIFT][ESCAPE]
sequence to get back to the switch-on conditon. (SAVE anything you need to before doing this!)
You can prove this by simply typing:
N E W : C L S
. . ..after you have broken out of the previous program. Now type:.
D R A W 1 0 0 , 1 0 0
The
instruction draws a straight line from the last location of the GRAPHICS cursor to the
DRAW
x,y coordinate point specified (100,100). The GRAPHICS CURSOR is an invisible concept that
indicates the point at which the next graphics operation will occur.
To find out where it is, you must use the functions XPOS and YPOS
Type in:
.
P R I N T X P O S
The answer is
100
(which is the same for YPOS at this point)
Note that if the text goes down to the bottom of the screen and causes the display to be moved up
(' scrolled' up), the graphics display will move up as well but the graphics cursor position remains the
same as before. Try it - hold down the cursor down key [? ] until the screen clears away at the top,
then ask for XPOS and YPOS again. The graphics cursor value is still there in the memory.
To specify a colour for a line drawn, add the instruction at the end of the DRAW command (see the
description of the PLOT command after the program on the previous page - it works the same way).
You must first have specified the INK - and remember that you can only use the number of INKS
and colours that are permissible in the screen mode you are using.
To see this, type in:
1 0 MODE 1
20 I N K 0 , 1 0
3 0 O R I G I N 0 , 0
4 0 I N K 1 , 2 6
5 0 I N K 2,0 2,0
6 0 D R A W 3 2 0 , 4 0 0 , 1
7 0 D R A W 6 4 0 , 0 , 2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents