home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / soundCD_1.03.iso / players / WinAmp / winamp3_0-full.exe / Scripts / DMove / scripts / dmove.m next >
Text File  |  2002-05-30  |  2KB  |  106 lines

  1. #include "../../../lib/std.mi"
  2.  
  3. Global Layer fx;
  4. Global Layout thisl;
  5. Global Vis _vis;
  6. Global Double rp, dp, tp, ap;
  7. Global Int ef;
  8. Global Layer Next;
  9.  
  10. FX.fx_onGetPixelA(double r, double d, double x, double y) {
  11.   if (ef == 0) return cos(d*3.14159);
  12.   return 1.0;
  13. }
  14.  
  15. Fx.fx_onGetPixelR(double r, double d, double x, double y) {
  16.   if (!ef || ef==1) return r+cos(rp);
  17.   if (ef == 3) return r-rp;
  18.   return r;
  19. }
  20.  
  21. Fx.fx_onGetPixelD(double r, double d, double x, double y) {
  22.   if (!ef || ef==2) return d*(1.3-sin(dp)) + cos(tp)*0.2;
  23.   if (ef == 3) return d*(1.01+cos(rp*0.325));
  24.   return d;
  25. }
  26.  
  27. Fx.fx_onGetPixelY(double r, double d, double x, double y) {
  28.   if (ef==4) return y+sin(x-rp);
  29.   return y;
  30. }
  31.  
  32. Fx.fx_onFrame() {
  33.   rp = rp + 0.2;
  34.   dp = dp + 0.1;
  35.   tp = tp + 0.3;
  36.   ap = ap + 0.05;
  37. }
  38.  
  39. Next.onLeftButtonDown(int x, int y) { 
  40.   ef = ef+1;
  41.   if (ef == 6) 
  42.     ef = 0;
  43.   if (ef == 4) 
  44.     Fx.fx_setRect(1); 
  45.   else 
  46.     Fx.fx_setRect(0);
  47.   if (ef == 0) Fx.fx_setAlphaMode(2);
  48.   else Fx.fx_setAlphaMode(0);
  49.  
  50.   Fx.fx_setWrap(0);
  51.   if (ef == 0)
  52.     Fx.fx_setGridSize(4,4);
  53.   else if (ef == 1 || ef == 3) 
  54.   {
  55.     Fx.fx_setGridSize(1,1);
  56.     Fx.fx_setWrap(1);
  57.   }
  58.   else if (ef == 2)
  59.     Fx.fx_setGridSize(6,6);
  60.   else if (ef == 4)
  61.     Fx.fx_setGridSize(4,4);
  62.   if (ef != 5) { 
  63.     _vis.hide();
  64.   } else {
  65.     _vis.show();
  66.   }
  67.   if (ef == 0 || ef == 2 || ef == 4) {
  68.     Fx.setAlpha(255);
  69.   } else {
  70.     Fx.setAlpha(192);
  71.   }
  72. }
  73.  
  74. thisl.onSetVisible(int v) {
  75.   Fx.fx_setEnabled(v);
  76. }
  77.  
  78. _vis.onLeftButtonDown(int x, int y) {
  79.   complete;
  80. }
  81.  
  82. System.onScriptLoaded() {
  83.  
  84.   thisl = getContainer("DMove").getLayout("Normal");
  85.   Next = thisl.getObject("next");
  86.   Fx = thisl.getObject("logo");
  87.   _vis = thisl.getObject("vis");
  88.  
  89.   _vis.hide();
  90.  
  91.   Fx.fx_setBgFx(0);
  92.   Fx.fx_setWrap(0);
  93.   Fx.fx_setBilinear(1);
  94.   Fx.fx_setAlphaMode(2);
  95.   Fx.fx_setGridSize(8,8);
  96.   Fx.fx_setRect(0);
  97.   Fx.fx_setClear(1);
  98.   Fx.fx_setLocalized(1);
  99.   Fx.fx_setRealtime(1);
  100.   Fx.fx_setSpeed(30);
  101.  
  102.   ef = 4;
  103.   Next.onLeftButtonDown(0,0);
  104. }
  105.  
  106.