Difference between revisions of "LlGetTextureOffset"

From Second Life Wiki
Jump to navigation Jump to search
 
m (<lsl> tag to <source>)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSLFunctionAll|func_id=178|func_sleep=0.0|func_energy=10.0|func=llGetTextureOffset|return_type=vector|p1_type=integer|p1_name=side|func_footnote=Returns the texture offset of side in the x and y components of a vector|return_text|spec|caveats|examples|helpers|related|also|notes}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
{{LSL_Function
|inject-2={{LSL_Function/face|face|ALL_SIDES=returns the value for face zero.|return={{LSL VR|0.0|0.0|0.0}}}}
|func_id=178|func_sleep=0.0|func_energy=10.0
|func=llGetTextureOffset
|return_type=vector|p1_type=integer|p1_name=face
|func_footnote
|func_desc
|return_text=that is the texture offset of '''face''' in the x ("U", horizontal) and y ("V", vertical) components. The z component is unused.
|spec
|caveats
|constants
|examples=
<source lang="lsl2">//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;
        }
    }
}</source>
<source lang="lsl2">
vector offsetVec = llGetTextureOffset(0);
float u = offsetVec.x;
float v = offsetVec.y;
// z is not used.
</source>
|helpers
|also_functions={{LSL DefineRow||[[llOffsetTexture]]|}}
{{LSL DefineRow||[[llGetNumberOfSides]]|}}
|also_tests
|also_events
|also_articles
|notes
|cat1=Texture
|cat2=Face
|cat3
|cat4
}}

Latest revision as of 02:01, 22 January 2015

Summary

Function: vector llGetTextureOffset( integer face );
0.0 Forced Delay
10.0 Energy

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>

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

Signature

function vector llGetTextureOffset( integer face );