home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / development / heliosdemodisk3.dms / heliosdemodisk3.adf / Source / GraphicsLibScroll.src < prev    next >
Text File  |  1994-12-14  |  7KB  |  209 lines

  1.  
  2.   \ **********************************************************************
  3.   \
  4.   \                ***************************************
  5.   \                HeliOS GraphicsLib Multi-scroll Example
  6.   \                ***************************************
  7.   \
  8.   \ This short example allows you to experiment with the GraphicsLib multi-
  9.   \ scroll functions by giving you a framework of code into which you can
  10.   \ place different parameters.
  11.   \
  12.   \ **********************************************************************
  13.  
  14.   FORGET **CORE**
  15.  
  16.   CREATEL SCROLLSTRUCT1
  17.  
  18.   FRPORT D,   \    Pointer to the RastPort containing the scroll area.
  19.   32 ,        \    Scroll top left corner horizontal pixel position.
  20.   80 ,        \    Scroll top left corner vertical pixel position.
  21.   100 ,       \    Scroll pixel width.
  22.   50 ,        \    Scroll pixel height.
  23.   -1 ,        \    Scroll plane useage mask.
  24.   1 ,         \    Horizontal background fill flag.
  25.   1 ,         \    Vertical background fill flag.
  26.   0 ,         \    External user-code horizontal fill for 1st scroll.
  27.   0 ,         \    External user-code vertical fill for 1st scroll.
  28.   0 ,         \    External user-code horizontal fill for repeat scrolls.
  29.   0 ,         \    External user-code vertical fill for repeat scrolls.
  30.   0 ,         \    Reserved.
  31.   0 ,         \    Specifies blitwait video beam position.
  32.   0 ,         \    Reserved.
  33.  
  34.   CREATEL SCROLLSTRUCT2
  35.  
  36.   FRPORT D,   \    Pointer to the RastPort containing the scroll area.
  37.   185 ,       \    Scroll top left corner horizontal pixel position.
  38.   150 ,       \    Scroll top left corner vertical pixel position.
  39.   100 ,       \    Scroll pixel width.
  40.   50 ,        \    Scroll pixel height.
  41.   -1 ,        \    Scroll plane useage mask.
  42.   1 ,         \    Horizontal background fill flag.
  43.   1 ,         \    Vertical background fill flag.
  44.   0 ,         \    External user-code horizontal fill for 1st scroll.
  45.   0 ,         \    External user-code vertical fill for 1st scroll.
  46.   0 ,         \    External user-code horizontal fill for repeat scrolls.
  47.   0 ,         \    External user-code vertical fill for repeat scrolls.
  48.   0 ,         \    Reserved.
  49.   0 ,         \    Specifies blitwait video beam position.
  50.   0 ,         \    Reserved.
  51.  
  52.   CREATEL SCROLLSTRUCT3
  53.  
  54.   FRPORT D,   \    Pointer to the RastPort containing the scroll area.
  55.   350 ,       \    Scroll top left corner horizontal pixel position.
  56.   80 ,        \    Scroll top left corner vertical pixel position.
  57.   100 ,       \    Scroll pixel width.
  58.   50 ,        \    Scroll pixel height.
  59.   -1 ,        \    Scroll plane useage mask.
  60.   1 ,         \    Horizontal background fill flag.
  61.   1 ,         \    Vertical background fill flag.
  62.   0 ,         \    External user-code horizontal fill for 1st scroll.
  63.   0 ,         \    External user-code vertical fill for 1st scroll.
  64.   0 ,         \    External user-code horizontal fill for repeat scrolls.
  65.   0 ,         \    External user-code vertical fill for repeat scrolls.
  66.   0 ,         \    Reserved.
  67.   0 ,         \    Specifies blitwait video beam position.
  68.   0 ,         \    Reserved.
  69.  
  70.   CREATEL SCROLLSTRUCT4
  71.  
  72.   FRPORT D,   \    Pointer to the RastPort containing the scroll area.
  73.   494 ,       \    Scroll top left corner horizontal pixel position.
  74.   150 ,       \    Scroll top left corner vertical pixel position.
  75.   100 ,       \    Scroll pixel width.
  76.   50 ,        \    Scroll pixel height.
  77.   -1 ,        \    Scroll plane useage mask.
  78.   1 ,         \    Horizontal background fill flag.
  79.   1 ,         \    Vertical background fill flag.
  80.   0 ,         \    External user-code horizontal fill for 1st scroll.
  81.   0 ,         \    External user-code vertical fill for 1st scroll.
  82.   0 ,         \    External user-code horizontal fill for repeat scrolls.
  83.   0 ,         \    External user-code vertical fill for repeat scrolls.
  84.   0 ,         \    Reserved.
  85.   0 ,         \    Specifies blitwait video beam position.
  86.   0 ,         \    Reserved.
  87.  
  88.   D0 DVARIABLE SCROLLDATA1
  89.   D0 DVARIABLE SCROLLDATA2
  90.   D0 DVARIABLE SCROLLDATA3
  91.   D0 DVARIABLE SCROLLDATA4
  92.  
  93.   : DrawBevelBox
  94.  
  95.   D>R
  96.   DI   4.  D+ @L 4 -       \   LeftEdge(w)
  97.   DI   6.  D+ @L 2-        \   TopEdge(w)
  98.   DI   8.  D+ @L 8 +       \   Width(w)
  99.   DR> 10.  D+ @L 4 +       \   Height(w)
  100.   6                        \   HiPen(w)
  101.   6                        \   LoPen(w)
  102.   1                        \   Outline Colour(w)
  103.   1                        \   Bevel Width(w)
  104.   -1                       \   Inner Rectangle Colour(w)
  105.   -1                       \   Inner Rectangle Outline Colour(w)
  106.   0                        \   Inner Rectangle X-Inset ->(w)
  107.   0                        \   Inner Rectangle X-Inset <-(w)
  108.   0                        \   Inner Rectangle Y-Inset ^ (w)
  109.   0                        \   Inner Rectangle Y-Inset Down(w)
  110.   FRPORT                   \   RPort(l)
  111.   36 GADGETLIB             \   SETBOX
  112.   35 GADGETLIB             \   DRAWDUMMY
  113.   ;
  114.  
  115.   : SCROLLTEST
  116.  
  117.   SCRCLR
  118.   2 BPENSET
  119.   2 2 CURPUT
  120.  
  121.   SCROLLSTRUCT1 31 GRAPHICSLIB        \ SETUPSCROLL
  122.   DDUP SCROLLDATA1 D!
  123.   D0<>
  124.  
  125.   SCROLLSTRUCT2 31 GRAPHICSLIB        \ SETUPSCROLL
  126.   DDUP SCROLLDATA2 D!
  127.   D0<>
  128.   AND
  129.  
  130.   SCROLLSTRUCT3 31 GRAPHICSLIB        \ SETUPSCROLL
  131.   DDUP SCROLLDATA3 D!
  132.   D0<>
  133.   AND
  134.  
  135.   SCROLLSTRUCT4 31 GRAPHICSLIB        \ SETUPSCROLL
  136.   DDUP SCROLLDATA4 D!
  137.   D0<>
  138.   AND
  139.  
  140.   IF
  141.     1 FPENSET
  142.     ." Press any key to scroll, and <Esc> to quit"
  143.  
  144.     1 4 CURPUT
  145.  
  146.     19 0
  147.     DO
  148.       ."  Let's have something here to scroll!  "
  149.       ."  Let's have something here to scroll!  "
  150.       CR
  151.     LOOP
  152.  
  153.     1 32 GADGETLIB                    \ Hires pixel shape
  154.  
  155.     SCROLLSTRUCT1 DrawBevelBox
  156.     SCROLLSTRUCT2 DrawBevelBox
  157.     SCROLLSTRUCT3 DrawBevelBox
  158.     SCROLLSTRUCT4 DrawBevelBox
  159.  
  160.     BEGIN
  161.       KEY
  162.       27 =
  163.       IF
  164.         1
  165.       ELSE
  166.  
  167.         SCROLLDATA1 D@                \ Area 1
  168.         1                             \ Number of iterations
  169.         -1                            \ Horizontal scroll
  170.         2                             \ Vertical scroll
  171.         32 GRAPHICSLIB                \ SCROLLIT -> Area 1
  172.  
  173.         SCROLLDATA2 D@                \ Area 2
  174.         1                             \ Number of iterations
  175.         1                             \ Horizontal scroll
  176.         -1                            \ Vertical scroll
  177.         32 GRAPHICSLIB                \ SCROLLIT -> Area 2
  178.  
  179.         SCROLLDATA3 D@                \ Area 3
  180.         1                             \ Number of iterations
  181.         -1                            \ Horizontal scroll
  182.         -2                            \ Vertical scroll
  183.         32 GRAPHICSLIB                \ SCROLLIT -> Area 3
  184.  
  185.         SCROLLDATA4 D@                \ Area 4
  186.         1                             \ Number of iterations
  187.         1                             \ Horizontal scroll
  188.         1                             \ Vertical scroll
  189.         32 GRAPHICSLIB                \ SCROLLIT -> Area 4
  190.  
  191.         0
  192.       THEN
  193.     UNTIL
  194.  
  195.     SCROLLDATA4 D@ 33 GRAPHICSLIB    \ FREESCRLDATA
  196.     SCROLLDATA3 D@ 33 GRAPHICSLIB    \ FREESCRLDATA
  197.     SCROLLDATA2 D@ 33 GRAPHICSLIB    \ FREESCRLDATA
  198.     SCROLLDATA1 D@ 33 GRAPHICSLIB    \ FREESCRLDATA
  199.  
  200.   ELSE
  201.     6 FPENSET
  202.     ." Allocation failed! Press <Space> to quit!" WAITSPACE
  203.   THEN
  204.  
  205.   SCRCLR
  206.   ;
  207.  
  208.   SCROLLTEST
  209.