91. Shadow printing ~~~~~~~~~~~~~~~ Text printing on the screen looks far bolder and nicer if it appears to cast a slight shadow. This is used to good effect in the titles to a number of commercial programs. Here is a very useful procedure to produce this in any mode with 4 or more colours; ie Modes 1,2 and 5. You must specify the two colours to be used, and these must not be the same as the current background colour. In the example below, colours 1 and 2 are used, and you can alter the MODE statement to either 1 or 5 to see how the function automatically adjusts to cater for the different graphic resolution. If you are sticking to just one mode, then you can simplify the function by getting rid of line 110, removing all references to A%, mode% and fact%, and substituting 32 or 64 for the variable fact% in lines 130 and 140. (The expression fact%DIV32 will of course also simplify to just 1 or 2.) If you do not want to have to specify the colours in the FN brackets, then you can omit them, remove all reference to c1% and c2% in the program, and merely substitute the required numbers in line 130 and 140. This will simplify the procedure even further, at the expense of versatility. A very pleasing effect can be produced by running the program below in Mode 2, after adding :COLOUR132:CLS: immediately after the MODE statement in line 10. You can alter the position of the shadow by trying different combinations of +4, 0 and -4 in place of the two -4's in line 130. Ie the shadow can fall above, below, to the right, left or centre of the text. Do remember that the Function is only for Modes 1,2 and 5; it simply won't work in the others. 10 MODE2:PRINTTAB(0,9)"WAKEFIELD "FNshad(1,2,"BBC")" MICROS" 30 END 40 : 100 DEFFNshad(c1%,c2%,text$):LOCALA%,mode%,fact%,v%,p% 110 A%=&87:mode%=(USR(&FFF4)AND&FF0000)DIV&10000 120 p%=POS:v%=VPOS:IFmode%=1THENfact%=32ELSEfact%=64 130 VDU5:GCOL0,c2%:MOVEp%*fact%-4*(fact%DIV32),((32-v%)*32-1)-4 140 PRINTtext$:GCOL0,c1%:MOVEp%*fact%,(32-v%)*32-1:PRINTtext$ 150 VDU4,31,p%+LEN(text$),v%:=""