home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 18 / CD_ASCQ_18_111294_W.iso / dos / prg / pas / pscrn55 / basic.exe / DEMOFADE.BAS < prev    next >
BASIC Source File  |  1994-10-09  |  3KB  |  86 lines

  1. '======================================================= DemoFade.Bas
  2. '
  3. '  DemoFade.BAS                   Copyright 1994, Rob W. Smetana
  4. '                                 A P-Screen support module.
  5. '
  6. '  Requires:   PScreen.Inc (declarations), PScreen.Obj (required routines)
  7. '              and Demo.Obj (contains examples of "callable" screens).
  8. '
  9. '  Purpose:    Demonstrate how to "fade" text-mode screens in!
  10. '
  11. '              VGA ONLY!  On non-VGA screens, the palette routines
  12. '              do nothing.  That means that on non-VGA screens,
  13. '              your screens will POP up instead of fading in.
  14. '
  15. '              Demonstrate how to use several P-Screen routines:
  16. '
  17. '                 psColorsOff           turn all colors OFF
  18. '                 psFadeIn              fade in screens
  19. '                 psFadeOut             fade screens out
  20. '                 psGetPalette ()       preserve existing palette
  21. '                 psSetPalette (...)    set any/all color registers
  22. '
  23. '  Notes:
  24. '
  25. '     You should ALWAYS call GetPalette BEFORE calling SetPalette.
  26. '     This preserves the current palette -- before you cream it.
  27. '     But... If you don't, calling SetPalette will do it for you!
  28. '     In other words, GetPalette sets an internal flag once you've
  29. '     preserved the palette.  If, when you call SetPalette, that
  30. '     flag is NOT set, SetPalette will call GetPalette for you.
  31. '
  32. '     ALSO:  Before displaying a screen, turn OFF all colors (see
  33. '     psColorsOff below) so your screen will NOT appear as you display
  34. '     it.  Once your screen has been "displayed" (but is invisible),
  35. '     use psFadeIn (or psSetPalette) to bring your screen to life!
  36. '
  37. '======================================================= DemoFade.Bas
  38.  
  39. DEFINT A-Z
  40.  
  41. '$INCLUDE: 'PScreen.INC'
  42.  
  43. DECLARE SUB Frog ()             '...a callable ASM/OBJ screen!
  44.  
  45. '=======================================================
  46. '   PowerBASIC users:   Un-rem the next line(s).
  47. '=======================================================
  48. ''$Include "PScreen.Inc"
  49. ''$Link    "pscreen.obj"
  50. ''$Link    "demo.obj"
  51. '=======================================================
  52. ' END  PowerBASIC users
  53. '=======================================================
  54.  
  55. CLS
  56. CALL psInitialize: CLS      '...for SHAREWARE versions ONLY
  57.  
  58.  
  59. SCREEN 0, 0, 0              '...for safety:  helps ensure that
  60.                             '   a mistake doesn't render your
  61.                             '   screen invisible.
  62.  
  63. CALL psGetPalette           '...ALWAYS begin by SAVING the palette
  64.  
  65. '...Turn all colors *OFF* so our screen does NOT appear when we display it!
  66.  
  67. CALL psColorsOff            '...turn OFF all colors!!!
  68.  
  69. '...here's another way to turn OFF all colors.
  70.    'CALL psSetPalette(0, 0, 255)
  71.  
  72. CALL Frog                   '...display our "callable" ASM/OBJ screen
  73.  
  74. CALL psFadeIn               '...fade our screen in!!!
  75.  
  76. '...Here's another way to fade IN the screen.  This approach gives
  77. '   YOU control over the speed.  Use "Step" values of 1-3.  Values
  78. '   above 5-10 are too fast.
  79. '    FOR A = 0 TO 255 STEP 3: CALL psSetPalette(A, 0, 255): NEXT
  80.  
  81. CALL psFadeOut              '...fade our screen Out!!!
  82.  
  83. CALL psFadeIn               '...fade it back in again!!!
  84.  
  85.  
  86.