Advertisement
worstbull

setTextureAnim

Sep 21st, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer iDIRECTION_POSITIVE = FALSE; //set this to TRUE or FALSE if you want to swap directions from negative to positive animation-direction, according.
  2. float fStepwidth = 0.01;
  3. float fStep = 0.0;
  4. integer link = LINK_THIS;
  5. integer face = ALL_SIDES;
  6. string texture = "5baee477-ea6d-bd2e-c213-c99a4393796f"; //put texture key here
  7. vector repeats = <1.0, 1.0, 0.0>;
  8. float fSleep = 0.02;
  9. float fRotation = 0.0;
  10. integer iANIMATE_X = TRUE; //set this to TRUE or FALSE, if you want to animate along the X-axis or the Y axis, according.
  11. default
  12. {
  13.     state_entry()
  14.     {
  15.         llSetTimerEvent(fSleep);
  16.     }
  17.     timer()
  18.     {
  19.         vector vOffset = <fStep, 0.0, 0.0>;
  20.         if (iANIMATE_X == FALSE)
  21.         {
  22.             vOffset = <0.0, fStep, 0.0>;
  23.         }
  24.         llSetLinkPrimitiveParamsFast(link,
  25.         [ PRIM_TEXTURE, face, texture, repeats, vOffset, fRotation ]);
  26.         if (iDIRECTION_POSITIVE)
  27.         {
  28.             fStep = fStep + fStepwidth;
  29.             if (fStep > 1.0)
  30.             {
  31.                 fStep = 0.0;
  32.             }
  33.         }
  34.         else
  35.         {
  36.             fStep = fStep - fStepwidth;
  37.             if (fStep < 0.0)
  38.             {
  39.                 fStep = 1.0;
  40.             }
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement