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

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