Difference between revisions of "LlOffsetTexture"
Jump to navigation
Jump to search
m (<lsl> tag to <source>) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{LSL_Function | {{LSL_Function | ||
|inject-2={{LSL Function/face|face}} | |||
|func_id=55|func_sleep=0.2|func_energy=10.0 | |func_id=55|func_sleep=0.2|func_energy=10.0 | ||
|func=llOffsetTexture | |func=llOffsetTexture | ||
|p1_type=float|p1_name=u | |p1_type=float|p1_name=u|p1_desc=horizontal (x) offset in the interval {{Interval|lte=1.0|gte=-1.0|center=u}}|p1_hover=horizontal (x) offset in the interval {{Interval/Text|lte=1.0|gte=-1.0|center=u}} | ||
|p2_type=float|p2_name=v | |p2_type=float|p2_name=v|p2_desc=vertical (y) offset in the interval {{Interval|lte=1.0|gte=-1.0|center=v}}|p2_hover=vertical (y) offset in the interval {{Interval/Text|lte=1.0|gte=-1.0|center=v}} | ||
|p3_type=integer|p3_name=face | |p3_type=integer|p3_name=face | ||
|func_desc=Sets the texture | |func_desc=Sets the texture {{LSLP|u}} & {{LSLP|v}} offsets for the chosen {{LSLP|face}}. | ||
|return_text | |return_text | ||
|spec | |spec | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples=< | |examples=<source lang="lsl2"> | ||
//Offsets the textures on 6 sides | //Offsets the textures on 6 sides | ||
float offset; | float offset; | ||
Line 27: | Line 27: | ||
} | } | ||
} | } | ||
</ | </source> | ||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llGetTextureOffset]]|}} | |also_functions={{LSL DefineRow||[[llGetTextureOffset]]|Returns a vector in the form {{LSL VR|u|v|0.0}}}} | ||
|also_tests | |also_tests | ||
|also_events | |also_events | ||
|also_articles | |also_articles | ||
|notes | |notes=If you use <code>vector offsetVec = [[llGetTextureOffset]]()</code> to get the vector of the current offset, then <code>u = offsetVec.x</code> and <code>v = offsetVec.y</code> | ||
|cat1=Face | |cat1=Face | ||
|cat2=Texture | |cat2=Texture |
Latest revision as of 14:03, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llOffsetTexture( float u, float v, integer face );0.2 | Forced Delay |
10.0 | Energy |
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.
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> |