Difference between revisions of "LlGetTextureOffset"

From Second Life Wiki
Jump to navigation Jump to search
m (injection is the way to go)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{LSL_Function/face|face|ALL_SIDES=as if on face zero.|return={{LSL VR|0.0|0.0|0.0}}}} {{LSL_Function
{{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_id=178|func_sleep=0.0|func_energy=10.0
|func=llGetTextureOffset
|func=llGetTextureOffset
Line 5: Line 6:
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the texture offset of '''face''' in the x and y components
|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
|spec
|caveats
|caveats
|constants
|constants
|examples=<pre>
|examples=
//Tells the owner the texture offset on 6 sides
<lsl>//Tells the owner the texture offset on all sides
default
default
{
{
     state_entry()
     state_entry()
     {
     {
         integer i;
         integer i = 0;
         for( i = 1; i < 7; i++ )
         integer max = llGetNumberOfSides();
         llSay(0,"Side " + (string)i + " texture offset is: " + (string)llGetTextureOffset(i));
        while(i < max)
         {
            llSay(0,"Face "+(string)i+" texture offset is " + (string)llGetTextureOffset(i));
            ++i;
        }
     }
     }
}
}</lsl>
</pre>
<lsl>
vector offsetVec = llGetTextureOffset(0);
float u = offsetVec.x;
float v = offsetVec.y;
// z is not used.
</lsl>
|helpers
|helpers
|also_functions
|also_functions={{LSL DefineRow||[[llOffsetTexture]]|}}
{{LSL DefineRow||[[llGetNumberOfSides]]|}}
|also_tests
|also_tests
|also_events
|also_events
Line 28: Line 39:
|notes
|notes
|cat1=Texture
|cat1=Texture
|cat2
|cat2=Face
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 18:28, 14 October 2010

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

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

}</lsl> <lsl> vector offsetVec = llGetTextureOffset(0); float u = offsetVec.x; float v = offsetVec.y; // z is not used.

</lsl>

See Also

Functions

•  llOffsetTexture
•  llGetNumberOfSides

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetTextureOffset( integer face );