Difference between revisions of "LlSetTextureAnim"

From Second Life Wiki
Jump to navigation Jump to search
Line 8: Line 8:
|p1_type=integer|p1_name=mode|p1_desc=bitfield of Mode flags
|p1_type=integer|p1_name=mode|p1_desc=bitfield of Mode flags
|p2_type=integer|p2_name=face
|p2_type=integer|p2_name=face
|p3_type=integer|p3_name=sizex|p3_desc=frames on the x-axis (left to right)
|p3_type=integer|p3_name=sizex|p3_desc=horizontal frames (ignored for [[ROTATE]] or [[SCALE]])
|p4_type=integer|p4_name=sizey|p4_desc=frames on the y-axis (left to right)
|p4_type=integer|p4_name=sizey|p4_desc=vertical frames (ignored for [[ROTATE]] or [[SCALE]])
|p5_type=float|p5_name=start|p5_desc=Start position/frame number
|p5_type=float|p5_name=start|p5_desc=Start position/frame number (or radians for [[ROTATE]])
|p6_type=float|p6_name=length|p6_desc=number of frames to display
|p6_type=float|p6_name=length|p6_desc=number of frames to display (or radians for [[ROTATE]])
|p7_type=float|p7_name=rate|p7_desc=frames per second
|p7_type=float|p7_name=rate|p7_desc=frames per second (must be greater then zero)
|func_footnote
|func_footnote=Frames are numbered from left to right, top to bottom, starting at 0.
|func_desc=Animate the texture on the specified face/faces by setting the texture scale and offset
|func_desc=Animate the texture on the specified face/faces by setting the texture scale and offset
|return_text
|return_text
|spec=
|spec
You can only have one texture animation on an object, calling llSetTextureAnim more than once on an object will reset it.
|caveats=*You can only have one texture animation on a prim
 
**Calling llSetTextureAnim more than once on a prim will reset it.
You can only do one traditional animation, ROTATE or SCALE at a time, you cannot combine masks. In the case of ROTATE or SCALE, sizex and sizey are ignored, and start and length are used as the start and length values of the animation. For rotation, start and length are in radians.
*You cannot combine ROTATE and SCALE
 
The face specified which face to animate. If face is ALL_SIDES, all textures on the object are animated.
 
The sizex and sizey describe the layout of the frames within the texture. sizex specifies how many horizontal frames and sizey is how many vertical frames.
 
start is the frame number to begin the animation on. Frames are numbered from left to right, top to bottom, starting at 0.
 
length is the number of frames to animate. 0 means to animate all frames after the start frame.
 
rate is the frame rate to animate at. 1.0 means 1 frame per second, 10.0 means 10 frames per second, etc.
 
|caveats
|constants={{{!}} {{Prettytable}}
|constants={{{!}} {{Prettytable}}
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
Line 51: Line 39:
{{!}}[[PING_PONG]]
{{!}}[[PING_PONG]]
{{!}}{{LSL Hex||8}}
{{!}}{{LSL Hex||8}}
{{!}}play animation going forwards, then backwards.
{{!}}Play animation going forwards, then backwards.
{{!}}-
{{!}}-
{{!}}[[SMOOTH]]
{{!}}[[SMOOTH]]
{{!}}{{LSL Hex||16}}
{{!}}{{LSL Hex||16}}
{{!}}slide in the X direction, instead of playing separate frames.
{{!}}Slide in the X direction, instead of playing separate frames.<br>Does nothing in [[ROTATE]] mode.
{{!}}-
{{!}}-
{{!}}[[ROTATE]]
{{!}}[[ROTATE]]

Revision as of 14:34, 23 February 2007

Summary

Function: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );
0.0 Forced Delay
10.0 Energy

Animate the texture on the specified face/faces by setting the texture scale and offset

• integer mode bitfield of Mode flags
• integer face face number or ALL_SIDES
• integer sizex horizontal frames (ignored for ROTATE or SCALE)
• integer sizey vertical frames (ignored for ROTATE or 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 be greater then zero)

start supports negative indexes. If face is ALL_SIDES then the function works on all sides. Frames are numbered from left to right, top to bottom, starting at 0.

Specification

Index Positive Negative
First 0 -length
Last length - 1 -1

Indexes

  • Positive indexes count from the beginning, the first item being indexed as 0, the last as (length - 1).
  • Negative indexes count from the far end, the first item being indexed as -length, the last as -1.

Modes Description
ANIM_ON 0x1 Texture animation is on.
LOOP 0x2 Loop the texture animation.
REVERSE 0x4 Play animation in reverse direction.
PING_PONG 0x8 Play animation going forwards, then backwards.
SMOOTH 0x10 Slide in the X direction, instead of playing separate frames.
Does nothing in ROTATE mode.
ROTATE 0x20 Animate texture rotation.
Does not work with SCALE
SCALE 0x40 Animate the texture scale.
Does not work with ROTATE

Caveats

  • If start is out of bounds the script continues to execute without an error message.
  • The function silently fails if its face 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

Examples

See Also

Articles

•  Negative Index

Deep Notes

Signature

function void llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );