Difference between revisions of "LlOffsetTexture"

From Second Life Wiki
Jump to navigation Jump to search
(mention defined ranges for x and y)
Line 3: Line 3:
|func_id=55|func_sleep=0.2|func_energy=10.0
|func_id=55|func_sleep=0.2|func_energy=10.0
|func=llOffsetTexture
|func=llOffsetTexture
|p1_type=float|p1_name=u|p1_desc=horizontal (x) offset
|p1_type=float|p1_name=u|p1_desc=horizontal (x) offset (between -1 and 1)
|p2_type=float|p2_name=v|p2_desc=vertical (y) offset
|p2_type=float|p2_name=v|p2_desc=vertical (y) offset (between -1 and 1)
|p3_type=integer|p3_name=face
|p3_type=integer|p3_name=face
|func_desc=Sets the texture '''u''' & '''v''' offsets for the chosen '''face'''.
|func_desc=Sets the texture '''u''' & '''v''' offsets for the chosen '''face'''.

Revision as of 13:47, 9 January 2009

Summary

Function: llOffsetTexture( float u, float v, integer face );

Sets the texture u & v offsets for the chosen face.

• float u horizontal (x) offset (between -1 and 1)
• float v vertical (y) offset (between -1 and 1)
• integer face face number or ALL_SIDES

If face is ALL_SIDES then the function works on all sides.

Caveats

  • This function causes the script to sleep for 0.2 seconds.
  • The function silently fails if its face value indicates a face that does not exist.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> //Offsets the textures on 6 sides float offset; default {

   state_entry()
   {
       integer i;
       
       for( i = 1; i < 7; i++ )
       {
           offset = offset + .1;
           llOffsetTexture( (float)offset, (float)offset, i);
       }
   }

}

</lsl>

Notes

If you use vector offsetVec = llGetTextureOffset() to get the vector of the current offset, then u = offsetVec.x and v = offsetVec.y

See Also

Functions

•  llGetTextureOffset Returns a vector in the form <u, v, 0.0>

Deep Notes

Search JIRA for related Issues

Signature

function void llOffsetTexture( float u, float v, integer face );