
' NOTE: For its appearance in JUMPDISK, the text of this listing has been
' PowerPacked. See item on decrunching if you wish to unpack this text. This
' is the source code for SPRINT, which is in this same directory in running
' form.

'    ********************************************
'    *                                          *
'    *              Basic Example               *
'    *         of shadow printing for           *
'    *           JUMPDISK Magazine              *
'    *                                          *
'    *        Amiga Basic/HiSoft Basic          *
'    *                                          *
'    *                                          *
'    ********************************************

'$OPTION Y+ This is for HiSoft Basic.  It disables the Workbench window.

'------->  Open graphics library.
   LIBRARY "graphics.library"

'-------> Open our screen, window and setup our palette.
   SCREEN 1,640,200,3,2
   WINDOW 1,"   © 1991 by Joe Rattz, Jr.                        JUMPDISK Magazine",,,1
   PALETTE 0,.43,.5,.625      'Gray
   PALETTE 1,0,0,0            'Black
   PALETTE 2,1,1,1            'White
   PALETTE 3,.125,.8125,.9375 'Lt. Blue     
   PALETTE 4,1,0,0            'Red
   PALETTE 5,1,1,0            'Yellow

'------->  Layout the screen.
   CALL SPrint("Enhanced Basic Text Output",200,15,3,1)
   LINE (100,22) - STEP(400,0),2 ' 3D horizontal - white
   LINE (100,23) - STEP(400,0),1 ' 3D horizontal - black
   LINE (299,24) - STEP(0,100),2 ' 3D vertical - white
   LINE (300,24) - STEP(0,100),2 ' 3D vertical - white
   LINE (301,24) - STEP(0,100),1 ' 3D vertical - black
   LINE (302,24) - STEP(0,100),1 ' 3D vertical - black
   CALL SPrint("=================>",10,180,5,1)
   CALL SPrint("Click Mouse Or Any Key To Continue",180,180,4,1)
   CALL SPrint("<===============",480,180,5,1)

'------->  Layout the normal text side.
   LOCATE 4,16
   COLOR 2
   PRINT "Normal Basic Output"
   LOCATE 6,20
   COLOR 4
   PRINT "Line 6"
   LOCATE 7,20
   COLOR 5
   PRINT "Line 7"

'------->  Layout the Enhanced text side.
   CALL SPrint("Enhanced Basic Output",321,32,2,1)
   SetDrMd WINDOW(8),0

   COLOR 4
   Move WINDOW(8),356,46
   Text WINDOW(8),SADD("Pixel Line 46"),13

   COLOR 5
   Move WINDOW(8),356,54
   Text WINDOW(8),SADD("Pixel Line 54"),13

   CALL SPrint("Isn't this pretty output?",310,70,5,4)
   CALL SPrint("Raised print!",360,85,2,1)
   CALL SPrint("Engraved print!",350,95,1,2)

   CALL SPrint("P",330,122,5,1)
   CALL SPrint("R",338,121,2,1)
   CALL SPrint("I",346,120,3,1)
   CALL SPrint("N",354,119,4,1)
   CALL SPrint("T",362,118,5,1)

   CALL SPrint("c",378,116,2,1)
   CALL SPrint("a",386,115,3,1)
   CALL SPrint("n",394,114,4,1)
   CALL SPrint("'",402,113,5,1)
   CALL SPrint("t",410,112,2,1)

   CALL SPrint("d",426,112,3,1)
   CALL SPrint("o",434,113,4,1)

   CALL SPrint("t",450,115,5,1)
   CALL SPrint("h",458,116,2,1)
   CALL SPrint("i",464,117,3,1)
   CALL SPrint("s",472,118,4,1)
   CALL SPrint("!",480,119,5,1)

'------->  Wait for activity.
   SLEEP 'HiSoft only needs one sleep, but Amiga Basic seems to need 2
   SLEEP

'------->  Close all libraries we have opened.
   LIBRARY CLOSE 

'------->  Shut down the resources we opened.
   WINDOW CLOSE 1   
   SCREEN CLOSE 1  

END

SUB SPrint(Txt$,XPosition%,YPosition%,FColor%,BColor%) STATIC
'-------> This subprogram prints to any pixel location with/out shadows.
'-------> Txt$ = the string to be printed.
'-------> XPosition = how many pixels from the left edge to print.
'-------> YPosition = how many pixels from the top edge to print.
'-------> FColor = the main text color (foreground).
'-------> BColor = the shadow text color (background).
   SetDrMd WINDOW(8),0
   COLOR BColor%
   Move WINDOW(8),XPosition%+2,YPosition%+1
   Text WINDOW(8),SADD(Txt$),LEN(Txt$)
   COLOR FColor%
   Move WINDOW(8),XPosition%,YPosition%
   Text WINDOW(8),SADD(Txt$),LEN(Txt$)
END SUB
