home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 3 / Amoszine 3.adf / Celebrity_source / line_copy1.AMOS.pp / line_copy1.AMOS / line_copy1.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1992-02-26  |  2.8 KB  |  111 lines

  1. ' *************************************************************
  2. '
  3. '                            Line Copy 
  4. '
  5. '                   - ** By Paul Nordovics ** -
  6. '
  7. ' If you use this in your own programs I won't be offended if
  8. '             you mention me in your creditz !!! 
  9. ' *************************************************************
  10. '
  11. ' line_copy11[source,sx1,sy1,sx2,sy2,dest,dx1,dy1,speed,_direction]  
  12. '
  13. '        source = screen number where image is 
  14. '       sx1,sy1 = co-ords of top-left corner of area to be copied  
  15. '       sx2,sy2 = co-ords of bottom-right corner of area to be copied  
  16. '          dest = screen number where image is being copied to 
  17. '       dx1,dy1 = co-ords of top-left corner where image is being copied to  
  18. '         speed = speed of fx
  19. ' _direction: 0 = top 2 bottom 
  20. '             1 = bottom 2 top 
  21. '             2 = left 2 right 
  22. '             3 = right 2 left 
  23. '
  24. ' *************************************************************
  25. '
  26. Hide 
  27. ' ******************** 
  28. ' set up source screen 
  29. ' ******************** 
  30. Unpack 1 To 0
  31. '
  32. ' *************************
  33. ' set up destination screen
  34. ' *************************
  35. Screen Open 1,320,256,16,Lowres
  36. Curs Off : Flash Off 
  37. Get Palette 0
  38. Cls 0 : Paper 0
  39. '
  40. Do 
  41.    For K=0 To 3
  42.       Cls 0
  43.       LINE_COPY1[0,32,33,290,188,1,32,33,1,K]
  44.       Wait 25
  45.    Next K
  46. Loop 
  47. '
  48. End 
  49. '
  50. Procedure LINE_COPY1[SOURCE,SX1,SY1,SX2,SY2,DEST,DX1,DY1,SPEED,_DIRECTION]
  51.    ' ************ 
  52.    ' top 2 bottom 
  53.    ' ************ 
  54.    If _DIRECTION=0
  55.       For _LOOP=0 To 1
  56.          DY=DY1+_LOOP
  57.          For K=SY1+_LOOP To SY2 Step 2
  58.             Screen Copy SOURCE,SX1,K,SX2+1,K+1 To DEST,DX1,DY
  59.             Add DY,2
  60.             If SPEED>0
  61.                Wait SPEED
  62.             End If 
  63.          Next K
  64.       Next _LOOP
  65.    End If 
  66.    ' ************ 
  67.    ' bottom 2 top 
  68.    ' ************ 
  69.    If _DIRECTION=1
  70.       For _LOOP=0 To 1
  71.          DY=DY1+(SY2-SY1)-_LOOP
  72.          For K=SY2-_LOOP To SY1 Step -2
  73.             Screen Copy SOURCE,SX1,K,SX2+1,K+1 To DEST,DX1,DY
  74.             Add DY,-2
  75.             If SPEED>0
  76.                Wait SPEED
  77.             End If 
  78.          Next K
  79.       Next _LOOP
  80.    End If 
  81.    ' ************ 
  82.    ' left 2 right 
  83.    ' ************ 
  84.    If _DIRECTION=2
  85.       For _LOOP=0 To 1
  86.          DX=DX1+_LOOP
  87.          For K=SX1+_LOOP To SX2 Step 2
  88.             Screen Copy SOURCE,K,SY1,K+1,SY2+1 To DEST,DX,DY1
  89.             Add DX,2
  90.             If SPEED>0
  91.                Wait SPEED
  92.             End If 
  93.          Next K
  94.       Next _LOOP
  95.    End If 
  96.    ' ************ 
  97.    ' right 2 left 
  98.    ' ************ 
  99.    If _DIRECTION=3
  100.       For _LOOP=0 To 1
  101.          DX=DX1+(SX2-SX1)-_LOOP
  102.          For K=SX2-_LOOP To SX1 Step -2
  103.             Screen Copy SOURCE,K,SY1,K+1,SY2+1 To DEST,DX,DY1
  104.             Add DX,-2
  105.             If SPEED>0
  106.                Wait SPEED
  107.             End If 
  108.          Next K
  109.       Next _LOOP
  110.    End If 
  111. End Proc