Difference between revisions of "LlGetTextureOffset"

From Second Life Wiki
Jump to navigation Jump to search
m (injection is the way to go)
m (<lsl> tag to <source>)
 
Line 11: Line 11:
|constants
|constants
|examples=
|examples=
<lsl>//Tells the owner the texture offset on all sides
<source lang="lsl2">//Tells the owner the texture offset on all sides
default
default
{
{
Line 24: Line 24:
         }
         }
     }
     }
}</lsl>
}</source>
<lsl>
<source lang="lsl2">
vector offsetVec = llGetTextureOffset(0);
vector offsetVec = llGetTextureOffset(0);
float u = offsetVec.x;
float u = offsetVec.x;
float v = offsetVec.y;
float v = offsetVec.y;
// z is not used.
// z is not used.
</lsl>
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llOffsetTexture]]|}}
|also_functions={{LSL DefineRow||[[llOffsetTexture]]|}}

Latest revision as of 03:01, 22 January 2015

Summary

Function: vector llGetTextureOffset( integer face );

Returns a vector that is the texture offset of face in the x ("U", horizontal) and y ("V", vertical) components. The z component is unused.

• integer face face number or ALL_SIDES

If face is ALL_SIDES then the function returns the value for face zero.

Caveats

  • If face indicates a face that does not exist the return is <0.0, 0.0, 0.0>
All Issues ~ Search JIRA for related Bugs

Examples

//Tells the owner the texture offset on all sides
default
{
    state_entry()
    {
        integer i = 0;
        integer max = llGetNumberOfSides();
        while(i < max)
        {
            llSay(0,"Face "+(string)i+" texture offset is " + (string)llGetTextureOffset(i));
            ++i;
        }
    }
}
vector offsetVec = llGetTextureOffset(0);
float u = offsetVec.x;
float v = offsetVec.y;
// z is not used.

See Also

Functions

•  llOffsetTexture
•  llGetNumberOfSides

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetTextureOffset( integer face );