Difference between revisions of "LlScaleTexture"

From Second Life Wiki
Jump to navigation Jump to search
m (loop skipped index 0 and improved readability and added comment about delay of the function)
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/face|face}}{{LSL_Function/texture-cords|u|v}}
|inject-2={{LSL_Function/face|face}}
|func=llScaleTexture
|func=llScaleTexture
|sort=ScaleTexture
|sort=ScaleTexture
|func_id=54|func_sleep=0.2|func_energy=10.0
|func_id=54|func_sleep=0.2|func_energy=10.0
|p1_type=float|p1_name=u
|p1_type=float|p1_name=u|p1_desc=horizontal (x) scale in the interval {{Interval|lte=100.0|gte=-100.0|center=u}}|p1_hover=horizontal (x) scale in the interval {{Interval/Text|lte=100.0|gte=-100.0|center=u}}
|p2_type=float|p2_name=v
|p2_type=float|p2_name=v|p2_desc=vertical (y) scale in the interval {{Interval|lte=100.0|gte=-100.0|center=v}}|p2_hover=vertical (y) scale in the interval {{Interval/Text|lte=100.0|gte=-100.0|center=v}}
|p3_type=integer|p3_name=face
|p3_type=integer|p3_name=face
|func_footnote
|func_footnote
Line 14: Line 14:
|constants
|constants
|examples=
|examples=
<lsl>
<source lang="lsl2">
// WARNING:
// WARNING:
//      llScaleTexture has a delay of 200 miliseconds
//      llScaleTexture has a delay of 200 miliseconds
Line 57: Line 57:
//      face 5 >> 0.6
//      face 5 >> 0.6
//      face 6 >> 0.7
//      face 6 >> 0.7
</lsl>
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llGetTextureScale]]}}
|also_functions={{LSL DefineRow||[[llGetTextureScale]]}}

Latest revision as of 18:25, 10 March 2016

Summary

Function: llScaleTexture( float u, float v, integer face );
0.2 Forced Delay
10.0 Energy

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

• float u horizontal (x) scale in the interval [-100.0, 100.0]
• float v vertical (y) scale in the interval [-100.0, 100.0]
• integer face face number or ALL_SIDES

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

Specification

In the default texture mapping mode the scale units are in texture repeats per face. In the planar texture mapping mode the scale units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.

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.

Examples

// WARNING:
//      llScaleTexture has a delay of 200 miliseconds
//      that means every time the function is called within a script it'll take 0.2 seconds
//      for example the script below would take about 1.2 seconds....that's REALLY SLOW !!!
//
//      To work around that delay use the following instead:
//
//
//      llSetLinkPrimitiveParamsFast(integer link,
//          [PRIM_TEXTURE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians]);


// *******************************************************************************************************************



//Scales the textures on 6 sides
float scale;

default
{
    state_entry()
    {
        integer index;
        while (index < 7)
        {
            scale += 0.1;
            llScaleTexture((float)scale, (float)scale, index);

            ++index;
        }
    }
}

// output:
//      face 0 >> 0.1
//      face 1 >> 0.2
//      face 2 >> 0.3
//      face 3 >> 0.4
//      face 4 >> 0.5
//      face 5 >> 0.6
//      face 6 >> 0.7

See Also

Functions

•  llGetTextureScale

Deep Notes

Footnotes

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

Signature

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