'=========================================================================== ' Subject: COOL SHADED TEXT Date: 02-11-97 (18:28) ' Author: Nick Kochakian Code: QB, QBasic, PDS ' Origin: NickK@worldnet.att.net Packet: GRAPHICS.ABC '=========================================================================== DECLARE SUB shadetxt (x1!, y1!, x2!, y2!, way!) '---------------------------------------------------------------------------- 'Cool shaded text ' '2/11/97 '1997 By: - Nick Kochakian - ' 'If you have any comments or questions please e-mail me at: 'nickK@worldnet.att.net ' 'And if you would like to use the SHADETXT sub routine in your program 'please say something nice about me in your program! :) ' 'Have fun! :) '---------------------------------------------------------------------------- SCREEN 13 x = 10 y = 10 'The color of the text HAS to be color 16 LOCATE x, y: COLOR 16: PRINT "Shaded grey text" x1 = 71 y1 = 72 x2 = 200 y2 = 79 'How to select the range for your text: ' '1. Uncomment the LINE and END statements below '2. Adjust the x1,y1,x2,y2 values so a nice white box surrounds the text '3. Comment the LINE and END statements 'LINE (x1, y1)-(x2, y2), 15, B 'END 'There are 14 settings for the WAY variable! Try them all! 'way=1 -> Grey marble shaded text 'way=2 -> Ooze shade text... Works really good with a palette cycling routine! 'way=3 -> Light source is at the bottom of the screen 'way=4 -> The opposite of way=3 'way=5 -> Another marble effect 'way=6 -> Dark text with holes in it 'way=7 -> Another marble effect 'way=8 -> Bright at the bottom, dark/light at the top 'way=9 -> Centered light (dim) 'way=10 -> Centered light (brighter) 'way=11 -> Centered light (brightest) 'way=12 -> "Light source" is directly centered 'way=13 -> "Light source" is focused on the right side of the text 'way=14 -> The opposite of way=13 CALL shadetxt(x1, y1, x2, y2, 1) COLOR 15 SUB shadetxt (x1, y1, x2, y2, way) x = x1 y = y1 ctr = 1 curcol = 31 cc = 1 IF way = 1 THEN DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol: curc$ = "y" IF cc = 1 AND curc$ = "y" THEN curcol = curcol - 1: curc$ = "" IF cc = 2 AND curc$ = "y" THEN curcol = curcol + 1: curc$ = "" IF curcol < 18 THEN cc = 2 IF curcol > 30 THEN cc = 1 x = x + 1 IF x > x2 THEN x = x1: y = y + 1 IF y > y2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 2 THEN DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol: curc$ = "y" y = y + 1 IF y > y2 THEN y = 1: curcol = curcol + 1: x = x + 1 IF curcol > 30 THEN curcol = 16 IF x > x2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 3 THEN curcol = 31 char = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol x = x + 1 IF x > x2 THEN x = 1: y = y + 1: curcol = curcol + 1 IF char = 8 THEN curcol = 31 IF curcol < 16 THEN curcol = 31 IF curcol > 30 THEN curcol = 16 IF y > y2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 4 THEN curcol = 31 char = 0 DO y = y + 1 LOOP UNTIL y >= y2 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol x = x + 1 IF x > x2 THEN x = 1: y = y - 1: curcol = curcol + 1 IF char = 8 THEN curcol = 31 IF curcol < 16 THEN curcol = 31 IF curcol > 30 THEN curcol = 16 IF y < y1 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 5 THEN curcol = 16 char = 0 c = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: char = char + 1 IF char = 4 THEN curcol = curcol + 1: char = 0 IF curcol > 30 THEN c = 1 IF c = 1 THEN curcol = curcol - 1 IF curcol < 20 THEN curcol = 30 IF x > x2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 6 THEN curcol = 16 char = 0 c = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: char = char + 1 IF char = 4 THEN curcol = curcol + 1: char = 0 IF curcol > 20 THEN c = 1 IF c = 1 THEN curcol = curcol - 1 IF curcol < 16 THEN curcol = 20 IF x > x2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 7 THEN curcol = 16 char = 0 c = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: char = char + 1 IF char > .5 THEN curcol = curcol + 1: char = 0 IF curcol > 30 THEN c = 1 IF c = 1 THEN curcol = curcol - 1 IF curcol < 20 THEN curcol = 30 IF x > x2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 8 THEN curcol = 20 char = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol x = x + 1 IF x > x2 THEN x = 1: y = y + 1: char = char + 1 IF char = 1 THEN curcol = 21 IF char = 3 THEN curcol = 22 IF char = 4 THEN curcol = 23 IF char = 5 THEN curcol = 25 IF y > y2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 9 THEN curcol = 20 char = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol x = x + 1 IF x > x2 THEN x = 1: y = y + 1: char = char + 1 IF char = 1 THEN curcol = 21 IF char = 3 THEN curcol = 22 IF char = 4 THEN curcol = 24 IF char = 5 THEN curcol = 22 IF y > y2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 10 THEN curcol = 20 char = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol x = x + 1 IF x > x2 THEN x = 1: y = y + 1: char = char + 1 IF char = 1 THEN curcol = 22 IF char = 3 THEN curcol = 25 IF char = 4 THEN curcol = 27 IF char = 5 THEN curcol = 23 IF y > y2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 11 THEN curcol = 20 char = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol x = x + 1 IF x > x2 THEN x = 1: y = y + 1: char = char + 1 IF char = 1 THEN curcol = 23 IF char = 3 THEN curcol = 27 IF char = 4 THEN curcol = 29 IF char = 5 THEN curcol = 24 IF y > y2 THEN ctr = 2 LOOP UNTIL ctr = 2 END IF IF way = 12 THEN curcol = 17 cnttr = 1 chr = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: chr = chr + 1 IF chr = 4 THEN curcol = curcol + 1: chr = 0 IF curcol > 30 THEN cnttr = 2 LOOP UNTIL cnttr = 2 cnttr = 1 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: chr = chr + 1 IF chr = 4 THEN curcol = curcol - 1: chr = 0 IF curcol < 17 THEN curcol = 17 LOOP UNTIL x > x2 END IF IF way = 13 THEN curcol = 17 chr = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: chr = chr + 1 IF chr = 4 THEN curcol = curcol + 1: chr = 0 IF curcol > 30 THEN curcol = 30 LOOP UNTIL x > x2 END IF IF way = 14 THEN curcol = 30 chr = 0 DO IF POINT(x, y) = 16 THEN PSET (x, y), curcol y = y + 1 IF y > y2 THEN y = 1: x = x + 1: chr = chr + 1 IF chr = 4 THEN curcol = curcol - 1: chr = 0 IF curcol < 17 THEN curcol = 17 LOOP UNTIL x > x2 END IF END SUB