50 (Normally CLS clears the whole screen, but where independent text and graphics areas are defined, CLS only clears the text.) You will also notice that although some of the commands have told the computer to draw in areas of the screen outside the graphics window, you will not see this on the screen. Windows may overlap – in fact when you change mode both text and graphics windows fill the whole screen, and you can move windows without destroying what is on the screen, although changing mode does clear the screen. To reset both text and graphics windows to the whole screen, eg in the middle of a program, use VDU 26 .
VDU 5 enables text to be drawn at any position inside a graphics window – see chapter 34. Changing the colours of text and graphics Now back to text and graphics colours. Let us define the text background to be red and the graphics background to be yellow: COLOUR 129 Red text background GCOL 0,130 Yellow graphics background and then clear the text and graphics areas to their background colours:
CLS Clear text area CLG Clear graphics area Now to select the foreground colours for the two areas – for example to obtain yellow letters (text foreground) type COLOUR 2 and to get black graphics lines type GCOL 0,0 Test this out by typing Although you start up (in MODE 5 ) with the four colours set to black, red, yellow and white, you can select other colours (still of course only four at a time) by using VDU 19 , as we saw in chapter 1. See chapter 34 for more details of VDU 19 . DRAW 150,500 So far we have been working in command mode. Next try typing in this program. You can use MODE 4 to type the program in but nothing will happen until you run the program.
So, press BREAK and then the following: 10 MODE 5 20 VDU 24, 0; 0; 500; 1000; 30 VDU 28,10,20,19,5 40 COLOUR 129