OsMovePen

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (some format conversions)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
|threat_level=None
+
|threat_level=ignored
|function_syntax=LSL: string osMovePen( string drawList, integer x, integer y )
+
|permissions=true
 
+
|delay=0
C#: string osMovePen( string drawList, int x, int y )
+
|function_syntax=string osMovePen(string drawList, integer x, integer y)
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
// Example of osMovePen
 
// Example of osMovePen
Line 14: Line 14:
  
 
         CommandList = osSetPenSize( CommandList, 3 );              // Set the pen width to 3 pixels
 
         CommandList = osSetPenSize( CommandList, 3 );              // Set the pen width to 3 pixels
         CommandList = osSetPenColour( CommandList, "Blue" );      // Set the pen color to blue
+
         CommandList = osSetPenColor( CommandList, "Blue" );      // Set the pen color to blue
  
 
         for (i = 0; i < 256; i += 20)
 
         for (i = 0; i < 256; i += 20)
Line 27: Line 27:
 
}
 
}
 
</source>
 
</source>
|description=Appends a [[Drawing_commands#MoveTo|MoveTo]] drawing command to the string provided in '''drawList''' and returns the result.
+
|description=Appends a [[Drawing commands#MoveTo|MoveTo]] drawing command to the string provided in '''drawList''' and returns the result.
  
 
This moves the pen's location to the coordinates specified by the '''x''' and '''y''' parameters, without drawing anything.
 
This moves the pen's location to the coordinates specified by the '''x''' and '''y''' parameters, without drawing anything.
 
|
 
|
 
}}
 
}}

Latest revision as of 10:39, 7 December 2018

string osMovePen(string drawList, integer x, integer y)
Appends a MoveTo drawing command to the string provided in drawList and returns the result.

This moves the pen's location to the coordinates specified by the x and y parameters, without drawing anything.

Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
// Example of osMovePen
default
{
    state_entry()
    {
        string CommandList = ""; // Storage for our drawing commands
        integer i;
 
        CommandList = osSetPenSize( CommandList, 3 );              // Set the pen width to 3 pixels
        CommandList = osSetPenColor( CommandList, "Blue" );       // Set the pen color to blue
 
        for (i = 0; i < 256; i += 20)
        {
          CommandList = osMovePen( CommandList, 255, i );          // Move to the right side
          CommandList = osDrawLine( CommandList, 0, i+20 );        // Draw left and slightly down
        }
 
        // Now draw the lines
        osSetDynamicTextureData( "", "vector", CommandList, "width:256,height:256", 0 );
    }
}


Personal tools
General
About This Wiki