home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Graphics / PerfectPaint / rexx / circle / AnimPainting_Whirl.rx < prev    next >
Text File  |  1999-12-09  |  1KB  |  95 lines

  1. /* Script Rexx
  2.     AnimPainting for Circle
  3.     Whirl Effect*/
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.        parse ARG Port x1 y1 r b
  9.  
  10.     ADDRESS COMMAND
  11.     sens=0
  12.     if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/AnimPainting_Whirl') THEN DO
  13.         IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/AnimPainting_Whirl', "R") then DO
  14.             sens = READLN('lfile')
  15.             CALL CLOSE('lfile')
  16.         END
  17.     END
  18.  
  19.     ADDRESS value Port
  20.  
  21.     pp_CountFrames
  22.     nb=result
  23.     IF nb<2 then DO
  24.         pp_Warn 'Make*an*Anim*first.'
  25.         EXIT
  26.     END    
  27.  
  28.     Pi=3.1415926/180
  29.  
  30.     rr=r/360
  31.     r2=r
  32.     r=0
  33.  
  34.     pp_DialogInit 250 60 "*AnimPainting*Whirl*" 1
  35.         pp_Cycle 0 100 8 100 16 "Order" 1 "--->|<---" sens
  36.     pp_Dialog
  37.     rc=result
  38.     if rc=0 then
  39.         do
  40.             EXIT
  41.         end        
  42.  
  43.     pp_GetDialog 0
  44.     sens=result
  45.  
  46.  
  47.     CALL SavePrefs('AnimPainting_Whirl',sens)
  48.     ADDRESS value Port
  49.  
  50.     if sens=0 then DO
  51.       DO i=600 To 0 by -1
  52.         x = Sin(i*Pi)*r+x1
  53.       y = Cos(i*Pi)*r+y1
  54.             pp_Plot x y
  55.             pp_NextFrame
  56.             if r<r2 then DO 
  57.                 r=r+rr
  58.             END
  59.     END
  60.     END
  61.     ELSE
  62.     DO i=0 To 600
  63.         x = Sin(i*Pi)*r+x1
  64.       y = Cos(i*Pi)*r+y1
  65.             pp_Plot x y
  66.             pp_NextFrame
  67.             if r<r2 then DO
  68.                 r=r+rr
  69.             END
  70.          END
  71.  
  72. EXIT
  73.  
  74. SavePrefs: PROCEDURE
  75.     
  76.     Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
  77.  
  78.     if EXISTS(Prefname) THEN DO
  79.         ADDRESS COMMAND
  80.         'delete >nil: '||Prefname
  81.     END
  82.  
  83.     IF OPEN('pfile',PrefName,'W') THEN DO
  84.  
  85.     do i=2 to ARG()
  86.         CALL WRITELN('pfile',ARG(i))
  87.     end
  88.  
  89.     CALL CLOSE('pfile')
  90.  
  91. RETURN
  92.  
  93.  
  94.  
  95.