Painting ======== Introduction ------------ A tireless brush that never runs out, colours an Old Master might envy and your boundless imagination - all these come together in this program, created by Brian Smith of the Royal College of Art. Painting and your colour television set or video monitors are made for each other. Delight your children, your friends and yourself with a plentitude of effects. Use an airbrush, paint with letters, do cross-hatching or draw polygons. Then move on to the next program and gaze at ever-changing musical Trees. The booklet accompanying this pack explains in detail how to get your BBC Microcomputer working and how to use the programs. Suitable for anyone of any age interested in computers and creativity. ISBN 0 563 16550 2 Painting -------- The difference between this program and one that does calculations is the difference between making a television programme and watching it. In Painting you have 'paint' and 'brushes' and you create your own pictures. You can switch between colours and brushes and shapes. You can create new colours by using cross-hatching (see later) and you can also wipe the screen 'canvas' clean and start painting again. This program is another small step towards educating ourselves about computers - and part of this education is that computers are not just about numbers. The program will not replace actual paint and brushes and is not meant to. If your target, however, is enjoyment and creativity, it will add another string to your bow. Loading A Program ----------------- CHAIN"INDEX" (RETURN) Choose one of the programs shown on the screen and type in the number to the left of it. Press RETURN. The screen will clear and a message will appear confirming that the program you selected is being searched for. To load another program, press ESCAPE then CHAIN"INDEX" (RETURN) for a second time. You can CHAIN any file individually. Running The Program ------------------- The filename is "FIRSTPAINT". The program is actually in two parts: FIRSTPAINT and PAINTING. The first thing which appears is a listing of what the red function keys at the top of the keyboard do. Once you are familiar with the keys, you can press RETURN to load the rest of the program. There are two important components of the way you paint: 1. Cursor Movements 2. Commands Cursor Movements ---------------- A cursor is simply a mark that moves when you want it to. In fact, the word comes from the Latin for 'runner'. To see the cursor used in Painting, press down or rapidly tap one of the letter keys. Of course, you've got to direct and move the cursor. First, direct the cursor by using the arrow keys - right, left, up and down; or diagonally by combining a vertical and a horizontal arrow key. After you give the cursor a direction you give it movement: firmly hold down one of the number keys, say 5; try this now. The cursor moves. The higher the number on the number key, the faster the cursor moves. If the cursor moves off an edge of the screen it is placed back in the middle. The cursor is used to fix where you want to paint on the screen. Commands -------- Before dealing with the commands, there are some points you should notice. First, when you see the word 'HIT' on the screen, simply press the Space bar. Second, remember that if you move the cursor off the screen, it is brought back to the middle. Third, if you ever get to a stage where nothing seems to work, press the BREAK key, then type RUN to start the program again. The red keys are numbered f0 to f9. Each does something when you press it: f0 -- When you press this key, the screen is cleared. This means that anything you've painted on the screen disappears and you have a fresh canvas. You'll find this 'clear screen' command useful when things get cluttered up. But, just in case you change your mind, you are asked if you are sure before the command is obeyed. Type in 'Y' or 'N' then press RETURN. f1 -- When you tap this key, the question COLOUR (0 to 3)? appears. You use this key to select the colour you want to paint in. Simply type in the colour number when you see the question then press RETURN. If you do not choose a colour the program chooses it for you. Here are the colours corresponding to the numbers 0 to 3: 0 = black, 1 = red, 2 = yellow, 3 = white f2 -- The numbers 0 to 3 above are called logical colour numbers. But they can be changed to one of sixteen actual colours (0-15) on the screen. Pressing f2 commands the computer to do just this. You will need to look at your user manual to find out what the sixteen colours are. Remember that setting one of the logical colours (0-3) to one of the actual colours (0-15) may give a flashing effect as one colour gives way to another - you can get some pretty results this way. Let's take an example. Suppose you select, using the f1 key, the colour 1 (red). You press f2, and you're asked: COLOUR TO CHANGE (0-3)? You want to change 1 (red) to, say, magenta. Type in 1. Then in response to the next question, type 6. Press RETURN. Graphics and text you've already painted in red on the screen will change colour to magenta. And so on for other colour changes. f3 -- The usual way of placing colour on the screen is straightforward but you can get some optical effects by pressing his key. The message you'll see is: YOU CAN OR, XOR or NORMALISE THE COLOUR. Let's take each in turn. OR: This simply means that when you paint in a dark colour after you've painted in a light one, the dark colour will appear to go under the light colour not over it. Type O if you want this, then press RETURN. XOR: Here, when you paint one colour over another, a new colour appears: it's like mixing colours. If you paint a colour over itself, however, it disappears. Type 'X' if you want this, then press RETURN. NORMALISE: Here things are returned to the straightforward way of painting. Type 'N' if you want this, then press RETURN. You will not see these 'op effects' until you actually do some painting, using one of the other function keys (see below). f4 -- When you press this key, you are 'picking up' an airbrush to paint with. The airbrush is a cluster of dots. The question AIRBRUSH WIDTH (10-500)? appears. Type in a number, say 80. Then press RETURN. The number you type determines how broad your airbrush will be. Now, using the cursor and number keys, singly or in combination, you can move the airbrush across the surface of the screen, painting as you go (see below). But, since the airbrush first appears where the cursor is, set the cursor to where you want it on the screen *before* typing the width of the airbrush. To paint with the airbrush, first set the *direction* you want it to move in: use the arrow keys. Then use the number keys for speed of movement. If you have typed in a large number for the width, the brush area will form and move slowly. But you can actually store both directions and movements by pressing the number key and then the Space bar many times. This way, the brush will appear to paint steadily across the screen. You can even store a change of direction of the brush, while it is moving, by using the arrow keys. See the example below. If you drive the cursor off the screen, it is repositioned in the middle. Try this example sequence: Press down or rapidly tap a letter key to reveal where the cursor is. Position the cursor by, say, pressing the left arrow key, then pressing a number key to move it to where you want on the screen. Press f4. Type in 400. Press RETURN. Press the left and down arrow keys to give a diagonally left direction. Type 3 and press the Space bar, alternately, four times. Then change direction by, say, pressing the right arrow key. Then type the number 4 and press the Space bar, alternately, four or five times. You can do the second change of direction while the airbrush is moving in the first direction. You can press f4 to choose a different size of airbrush, or you can instead press any of the other function keys and carry on from there. What you now do stays on the screen together with what you've done before. Of course, you can clear the screen before doing anything else, by pressing f0. f5 -- When you press this key, you are 'picking up' a Paintbrush. You can position the cursor to where you want to start painting, as already explained, before you use this key. You are asked what WIDTH you want the paintbrush to be. A typical value for a small brush would be 50. Enter the width, then press RETURN. Then you are asked if you want to paint with a triangular or square brush stroke. Type in S (for square) or T (for triangle). Then press RETURN. You'll immediately get a shape where the cursor is. To paint across the screen. set the cursor to the position and direction you want. Then press a number key and the space bar alternately. If you drive the cursor off the screen, it is repositioned in the middle. Note that the brush can be used as an eraser, by making it small and setting it to the background colour. You can press f5 again to get another shape or size of brush and then start again. You can also, instead, press any other key and carry on from there. What you do now stays on the screen together with anything you've done before. Of course, you can always clear the screen, before doing anything else, by pressing f0. f6 -- When you press this key, you get a cross-hatching effect. The cross-hatch is a diagonally shaded square area. Type in a number, say 300, to give the WIDTH you want, then press RETURN. The next number you type is the SHADE FACTOR. It goes from 1 to 10. 1 gives a solid effect, 10 gives a sparse shading with gradations in between. Don't forget, you can position the cursor and move it. Each time you then press the space bar, you get the cross-hatch. After a cross-hatch is painted, you can get a different size and shade of cross-hatch by pressing f6 again. If you draw a cross-hatch in one colour, then overlap it with one in another colour, you can get 'new' colours if the lines of the cross-hatches fall close together. If you drive the cursor off the screen, it will be repositioned in the middle. You can also switch to pressing any of the other function keys. Anything you now do will appear on the screen together with what you've done before. If you want to paint something on a fresh 'canvas', press f0. f7 -- Pressing this key allows you to paint solid "polygons". If you want to start off painting on a particular part of the screen, position the cursor there first, using the arrow and number keys. When you are asked for the first radius, type in a number, say 100. Press RETURN. When asked for the second radius, type in a number, say 200. Press RETURN. Finally, type in the number of sides, say 30. Press RETURN. A polygon is drawn on the screen. You can position the cursor, give it a direction, then tap a number key and the space bar alternately to paint polygons on the screen. Bigger polygons take longer to paint, but you can store polygons and give them new directions in the same way as explainied in the Airbrush section. If you drive the cursor off the screen, it is repositioned in the middle. Don't forget that you can press another function key to do something else. Or you can press f7 again, choose another polygon, and carry on from there. Whatever you paint now stays on the screen together with what you've painted before. You can, of course, press f0 to clear the screen before doing anything new. f8 -- When you press this key you can paint in text: with full words or letters or with the keyboard symbols. Position the cursor where you want the text to appear before painting the text. The message you see is ENTER TEXT. Type in, say, your name. The press RETURN. The letters appear on the screen. Now you can move the cursor as explained before, and then alternately tape a number key and the Space bar to spread the text over the screen. If you want to place the letters in a distinctly different part of the screen, move the cursor there before pressing the Space bar. If you drive the cursor off the screen, it is repositioned in the middle. You can switch to pressing another key and carry on from there. Whatever you do now stays with what you've done before. You can, of course, clear the screen to begin with by pressing f0. f9 -- When you press this key, you are telling the program to finish. You are asked to confirm your wish, just in case you change your mind. After typing in your answer, press RETURN. You can now, if you want, run the program again by typing RUN. Don't forget, you can use f1 to select the colour you want to paint in, before you paint. You can also use f2 to change colours and f3 to get optical effects. You can experiment as much as you please, using combinations of the function keys in sequence - all of them, as you've seen. Because there are so many things you can do you may sometimes get puzzled. To make a completely fresh start, press BREAK and then type RUN (RETURN). You will find that you get the best results by not painting too busily - that is, by not using too many function keys at once. If you prefer, you can write down the functions on a strip of paper and tape it down just above the function keys. Summary ------- Arrow Keys - Movement f0 - Clear Screen f1 - Select Colour f2 - Reset Colour f3 - Optical Effects f4 - Airbrush f5 - Brush f6 - Cross-hatch f7 - Polygon f8 - Text f9 - Stop Note: After you give the cursor a direction, move it by pressing a number key. The higher the number of the key, the faster the cursor moves. Program Notes ------------- The program uses nearly all of the memory in a Model A machine once Mode 5 graphics have taken their share. The coding itself should not be taken as a model of programming. Memory restrictions have taken their toll. The Airbrush routiine works by plotting random points within a square area that is based on your width input and the current cursor position. The Brush routine uses the triangular fill command, PLOT 85, to draw either one triangle or two triangles (to give a square) at a time. The Cross-Hatch routine works by drawing a line diagonally *from* a certain position along from the cursor *to* the same distance up from the cursor, and then alternating this with the same sort of procedure in the top part of the area. The Polygon routine works by drawing a polygon, one side at a time. As each side is drawn, the centre is replotted using the triangular fill command from Basic, thus giving a succession of solid segments around the centre point. The Text Paint routine uses the fact that the text and graphics cursors can be joined together using the VDU 5 coommand in BASIC. Text can then be plotted using PRINT in the graphics area. The VDU 5 command is disabled each time the Space bar is pressed, so the cursor is always ready in the text area again. The programs in their "unpacked" versions are to be found further along the tape. These are mainly to allow users to examine and modify them if they wish to. Trees ----- The filename is TREES This program contrasts with Painting in that it is 'ready-made'. Simply run it, following the standard Loading instructions. The scene changes to the accompaniment of sound effects. You can always press ESCAPE to get out of the program, but you can still run it again after typing RUN (RETURN). Notes On Trees -------------- You can alter the number of trees at line 230. Lines 240 and 260 relate to the limits of the tree sizes. The number of 'branches' and 'twigs' can be changed at lines 300 and 320.