Difference between revisions of "LlOffsetTexture"

From Second Life Wiki
Jump to navigation Jump to search
m
m (<lsl> tag to <source>)
 
Line 11: Line 11:
|caveats
|caveats
|constants
|constants
|examples=<lsl>
|examples=<source lang="lsl2">
//Offsets the textures on 6 sides
//Offsets the textures on 6 sides
float offset;
float offset;
Line 27: Line 27:
     }
     }
}
}
</lsl>
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llGetTextureOffset]]|Returns a vector in the form {{LSL VR|u|v|0.0}}}}
|also_functions={{LSL DefineRow||[[llGetTextureOffset]]|Returns a vector in the form {{LSL VR|u|v|0.0}}}}

Latest revision as of 14:03, 22 January 2015

Summary

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

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

• float u horizontal (x) offset in the interval [-1.0, 1.0]
• float v vertical (y) offset in the interval [-1.0, 1.0]
• 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

//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);
        }
    }
}

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

Footnotes

  1. ^ The ranges in this article are written in Interval Notation.

Signature

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