Difference between revisions of "LlSetTextureAnim/zh-Hans"

From Second Life Wiki
Jump to navigation Jump to search
Line 9: Line 9:
|p1_type=integer|p1_name=mode|p1_desc=模式标志的掩码
|p1_type=integer|p1_name=mode|p1_desc=模式标志的掩码
|p2_type=integer|p2_name=face
|p2_type=integer|p2_name=face
|p3_type=integer|p3_name=sizex|p3_desc=horizontal frames (ignored for [[ROTATE]] and [[SCALE]])
|p3_type=integer|p3_name=sizex|p3_desc=水平帧数 (ignored for [[ROTATE]] and [[SCALE]])
|p4_type=integer|p4_name=sizey|p4_desc=vertical frames (ignored for [[ROTATE]] and [[SCALE]])
|p4_type=integer|p4_name=sizey|p4_desc=vertical frames (ignored for [[ROTATE]] and [[SCALE]])
|p5_type=float|p5_name=start|p5_desc=Start position/frame number (or radians for [[ROTATE]])
|p5_type=float|p5_name=start|p5_desc=开始的位置/帧的编号 ([[ROTATE]] 模式中是弧度)
|p6_type=float|p6_name=length|p6_desc=number of frames to display (or radians for [[ROTATE]])
|p6_type=float|p6_name=length|p6_desc=显示的帧数目 ([[ROTATE]] 模式中是弧度)
|p7_type=float|p7_name=rate|p7_desc=frames per second (must not be zero)
|p7_type=float|p7_name=rate|p7_desc=每秒的帧数 (不能为 0)
|func_footnote=Frames are numbered from left to right, top to bottom, starting at 0.<br/>If '''rate''' is negative, has the same effect as using the [[REVERSE]] flag.
|func_footnote=帧是按照从左到右,从上到下,从0开始的顺序来编号的。<br>如果 '''rate''' 是负数,和使用了 [[REVERSE]] 标志的效果是一样的。
|func_desc=Animate the texture on the specified face/faces by setting the texture scale and offset
|func_desc=在指定的面上播放贴图动画(缩放,移动贴图)
|return_text
|return_text
|spec
|spec
Line 86: Line 86:
|also_articles
|also_articles
|notes
|notes
|许可
|permission
|negative_index
|negative_index
|cat1=媒体
|cat1=Media
|cat2=效果
|cat2=Effects
|cat3=贴图
|cat3=Texture
|cat4=视频
|cat4=Video
}}
}}

Revision as of 02:28, 10 January 2008

Summary

Function: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );

在指定的面上播放贴图动画(缩放,移动贴图)

• integer mode 模式标志的掩码
• integer face face number or ALL_SIDES
• integer sizex 水平帧数 (ignored for ROTATE and SCALE)
• integer sizey vertical frames (ignored for ROTATE and SCALE)
• float start 开始的位置/帧的编号 (在 ROTATE 模式中是弧度)
• float length 显示的帧数目 (在 ROTATE 模式中是弧度)
• float rate 每秒的帧数 (不能为 0)

start supports negative indexes. If face is ALL_SIDES then the function works on all sides. 帧是按照从左到右,从上到下,从0开始的顺序来编号的。
如果 rate 是负数,和使用了 REVERSE 标志的效果是一样的。

Modes Description
ANIM_ON 0x01 启用贴图动画。
LOOP 0x02 循环贴图动画。
REVERSE 0x04 反向播放动画。
PING_PONG 0x08 先播放动画,然后再倒放。
SMOOTH 0x10 在 X 轴方向上平滑移动,代替播放单独的帧。
SCALEROTATE 模式中,都会平滑移动。
ROTATE 0x20 旋转贴图动画,
不要和 SCALE 一起使用。
SCALE 0x40 缩放贴图动画,
不要和 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
  • sizex & sizey are both limited to a range of 0 to 255
All Issues ~ Search JIRA for related Bugs

Examples

平滑移动一个贴图并且循环播放动画。

        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, 1);

反向平滑移动一个贴图。

        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, -1);

This divides a texture into 64 "cells", 8 across, and 8 down, and flips through them, left to right, top to bottom. This is useful for cell animation.

        llSetTextureAnim( ANIM_ON | LOOP, ALL_SIDES, 8, 8, 0, 64, 6.4 );

This rotates a texture counter-clockwise at 2 revolutions per second. Change the last value to -2*TWO_PI to rotate clockwise.

        llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, 2*TWO_PI);

缩放一张贴图。

        llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, 1, 1, 3, 2);

See Also

Articles

•  Negative Index

Deep Notes

Search JIRA for related Issues

Signature

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