OsDrawFilledPolygon

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:Quicklinks}}
+
{{osslfunc
[[Technical Reference | Technical Reference]] -> [[Technical Reference/terms | Terms]] -> [[Status | Status Page]] -> [[OSSL_Implemented| OSSL Implemented Functions]] -> [[Dynamic textures]] -> [[OsDrawFilledPolygon | osDrawFilledPolygon]]
+
|threat_level=ignored
 
+
|permissions=true
 
+
|delay=0
LSL: '''[[string]] osDrawFilledPolygon( [[string]] drawList, [[list]] xpoints, [[list]] ypoints )'''<br />
+
|function_syntax=string osDrawFilledPolygon(string drawList, list xpoints, list ypoints)
C#: '''[[string]] osDrawFilledPolygon( [[string]] drawList, [[LSL_List]] xpoints, [[LSL_List]] ypoints )'''
+
|ossl_example=<source lang="lsl">
 
+
 
+
Appends a [[Drawing_commands#FillPolygon|FillPolygon]] drawing command to the string provided in '''drawList''' and returns the result.
+
 
+
The polygon is drawn with the current pen size and color on the x,y point pairs that comes from LSL list. So (x[0],y[0]),(x[1],y[1]),(x[2],y[2]) would be an example of a polygon. The polygon created is filled with the selected pen color as well.
+
 
+
Example:
+
<source lang="lsl">
+
 
// Example of osDrawFilledPolygon
 
// Example of osDrawFilledPolygon
 
default
 
default
Line 18: Line 10:
 
     state_entry()
 
     state_entry()
 
     {
 
     {
        string CommandList = ""; // Storage for our drawing commands
+
    // Storage for our drawing commands
 +
        string CommandList = "";
  
        CommandList = osSetPenSize( CommandList, 3 );        // Set the pen width to 3 pixels
+
    // Set the pen width to 3 pixels
         CommandList = osSetPenColour( CommandList, "Blue" ); // Set the pen color to blue
+
         CommandList = osSetPenSize( CommandList, 3 );  
        CommandList = osDrawFilledPolygon( CommandList, [50,100,150], ["50",100,150.0] ); // You can use either integer, float or string
+
  
         // Now draw the polygon
+
    // Set the pen color to blue
 +
         CommandList = osSetPenColor( CommandList, "Blue" ); 
 +
 
 +
    // You can use either integer, float or string
 +
        CommandList = osDrawFilledPolygon( CommandList, [50,100,50], ["50",100,150.0] );
 +
 
 +
    // Now draw the polygon
 
         osSetDynamicTextureData( "", "vector", CommandList, "", 0 );
 
         osSetDynamicTextureData( "", "vector", CommandList, "", 0 );
 
     }
 
     }
 
}
 
}
 
</source>
 
</source>
 +
|description=Appends a [[Drawing commands#FillPolygon|FillPolygon]] drawing command to the string provided in '''drawList''' and returns the result.  This fills in the interior of the specified polygon.
 +
 +
The polygon is drawn with the current pen size and filled with the current color. So (x[0],y[0]),(x[1],y[1]),(x[2],y[2]) would be an example of a polygon. T
 +
|
 +
}}

Latest revision as of 13:34, 14 November 2018

string osDrawFilledPolygon(string drawList, list xpoints, list ypoints)
Appends a FillPolygon drawing command to the string provided in drawList and returns the result. This fills in the interior of the specified polygon.

The polygon is drawn with the current pen size and filled with the current color. So (x[0],y[0]),(x[1],y[1]),(x[2],y[2]) would be an example of a polygon. T

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 osDrawFilledPolygon
default
{
    state_entry()
    {
     // Storage for our drawing commands
        string CommandList = ""; 
 
     // Set the pen width to 3 pixels
        CommandList = osSetPenSize( CommandList, 3 ); 
 
     // Set the pen color to blue
        CommandList = osSetPenColor( CommandList, "Blue" );  
 
    // You can use either integer, float or string 
        CommandList = osDrawFilledPolygon( CommandList, [50,100,50], ["50",100,150.0] ); 
 
    // Now draw the polygon
        osSetDynamicTextureData( "", "vector", CommandList, "", 0 );
    }
}


Personal tools
General
About This Wiki