Difference between revisions of "LlSetTextureAnim"
(A detailed description of frames is too complex for the summary. Not sure if it belongs in spec or notes... leaning towards spec.)
m (added note that this becomes a property of the prim, plus link to online tool.)
|Line 80:||Line 80:|
Revision as of 11:40, 3 January 2009
|LSL Portal||Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials|
Animate the texture on the specified face/faces by setting the texture scale and offset.
|• integer||mode||–||mask of Mode flags|
|• integer||face||–||face number or ALL_SIDES|
|• integer||sizex||–||horizontal frames (ignored for ROTATE and SCALE)|
|• integer||sizey||–||vertical frames (ignored for ROTATE and SCALE)|
|• float||start||–||Start position/frame number (or radians for ROTATE)|
|• float||length||–||number of frames to display (or radians for ROTATE)|
|• float||rate||–||frames per second (must not be zero)|
start supports negative indexes.
If is ALL_SIDES then the function works on all sides.
Frames are numbered from left to right, top to bottom, starting at 0.
If rate is negative, it has the same effect as using the REVERSE flag.
Frames are sub-rectangles within the texture. A set of frames with 2 horizontal (sizex) and 3 vertical (sizey) means the overall texture is divided into 3 rows of 2 columns of images, each of which is a frame. llSetTextureAnim will animate across these 6 starting with the top left image and going across and down, optionally repeating. If SMOOTH is set the frames slide smoothly from one to the next, if off, each frame is displayed in turn centered on the face.
|ANIM_ON||Texture animation is on. This must be set to start the animation, cleared to stop it.|
|LOOP||Loop the texture animation.|
|REVERSE||Play animation in reverse direction.|
|PING_PONG||Play animation going forwards, then backwards.|
|SMOOTH||Slide in the X direction, instead of playing separate frames.|
In both SCALE and ROTATE modes, causes smooth transitions.
|ROTATE||Animate texture rotation.|
Does not work with SCALE
|SCALE||Animate the texture scale.|
Does not work with ROTATE
- If start is out of bounds the script continues to execute without an error message.
- The function silently fails if its value indicates a face that does not exist.
- You can only have one texture animation on a prim
- Calling llSetTextureAnim more than once on a prim will reset it.
- You cannot combine ROTATE and SCALE flags.
- sizex & sizey are both limited to a range of 0 to 255
- llSetTextureAnim when on shows the texture with 1 repeat in X and Y and 0 rotation and offset.
This slides a texture smoothly and loops it when it gets to the end.<lsl>llSetTextureAnim(ANIM_ON
Texture animation becomes a property of the prim (i.e., you can remove the script that started the animation, and the prim will remember the settings anyway.) Note, though, that as of Jan 2009, texture animation is still one of the prim properties that are lost when using the rezzed in world copy method of shift-drag. Jira: https://jira.secondlife.com/browse/VWR-640
An online-tool for rough and ready conversion of moving gifs to animated textures is here: http://www.peregrinesalon.com/anim/ (link valid as of Jan 2009.)