home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Graphics / PerfectPaint / rexx / Anim / Slim_Anim.rx < prev   
Text File  |  2000-08-15  |  1KB  |  78 lines

  1. /* Slim_Anim
  2.     Ce script va :
  3.     - construire une animation de 10 images
  4.     - faire un warp sur chaque image.
  5.     - jouer l'animation
  6.     */
  7.  
  8.     options results
  9.     parse ARG Port b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     width=result
  15.  
  16.     pp_GetHeight
  17.     height=result
  18.  
  19.     IF width=0 & height=0 then DO
  20.         pp_Warn 'Load*a*picture*first'
  21.         EXIT
  22.     END
  23.  
  24.     nbframe=10
  25.     Preview=0
  26.     pp_DialogInit 250 80 "*Slim*Anim*" 2
  27.         pp_Integer 0 100 8 100 16 "Frame*#*" 1 nbframe        
  28.         pp_Cycle 1 100 28 100 16 "Preview*Size" 1 "96x96|144x144|192x192" Preview
  29.     pp_Dialog
  30.     rc=result
  31.     if rc=0 then DO
  32.         EXIT
  33.     END        
  34.  
  35.     pp_GetDialog 0
  36.     nbframe=result
  37.     IF nbframe<2 then DO
  38.         pp_Warn 'Not*enough*frame.'        
  39.       EXIT
  40.     END
  41.     IF nbframe>999 then DO
  42.         nbframe=999
  43.     END
  44.  
  45.     pp_GetDialog 1
  46.     Preview=result    
  47.                 
  48.     pp_MakeAnim nbframe preview
  49.     
  50.     radius=50
  51.  
  52.     do i=1 to nbframe
  53.         pp_SetJiffies i 2
  54.         do z=0 to width by 50
  55.             do zz=0 to height by 50
  56.                 Dx=random(0,5,time('S'))
  57.                 Dy=random(0,5,time('S'))
  58.                 a=random(0,5,time('S'))
  59.                 if a>2 then
  60.                     do
  61.                         Dx=Dx*-1
  62.                     end
  63.                 a=random(0,5,time('S'))
  64.                 if a>2 then
  65.                     do
  66.                         Dy=Dy*-1
  67.                     end                
  68.                 pp_Warp z zz radius Dx Dy
  69.             end
  70.         end
  71.         pp_NextFrame
  72.     end
  73.  
  74.     pp_PlayAnim 1
  75.  
  76.     EXIT
  77.  
  78.