Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float fSleep = 0.02; //speed
- string sTexture = "5baee477-ea6d-bd2e-c213-c99a4393796f"; //put texture key here
- integer iLink = LINK_THIS; //linknumber
- integer iFace = ALL_SIDES; //linkface
- float fRotation = 0.0; //texture rotation
- vector vRepeats = <1.0, 1.0, 0.0>; //repeats
- integer iANIMATE_X = TRUE; //set this to TRUE or FALSE, if you want to animate along the X-axis or the Y axis, according.
- integer iDIRECTION_POSITIVE = FALSE; //set this to TRUE or FALSE if you want to swap directions from negative to positive animation-direction, according.
- float fStepwidth = 0.01; //jump per animation-frame
- float fStep = 0.0; //global variable, don't change
- setTextureAnim(string stexture, integer ilink, integer iface, float frotation, vector vrepeats, integer animatex, integer directionpositive, float fstepwidth)
- {
- vector vOffset = <fStep, 0.0, 0.0>;
- if (animatex == FALSE)
- {
- vOffset = <0.0, fStep, 0.0>;
- }
- llSetLinkPrimitiveParamsFast(ilink, [ PRIM_TEXTURE, iface, stexture, vrepeats, vOffset, frotation]);
- if (directionpositive)
- {
- fStep = fStep + fstepwidth;
- if (fStep > 1.0)
- {
- fStep = 0.0;
- }
- }
- else
- {
- fStep = fStep - fstepwidth;
- if (fStep < 0.0)
- {
- fStep = 1.0;
- }
- }
- }
- default
- {
- state_entry()
- {
- llSetTimerEvent(fSleep);
- }
- timer()
- {
- setTextureAnim(sTexture, iLink, iFace, fRotation, vRepeats, iANIMATE_X, iDIRECTION_POSITIVE, fStepwidth);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement