OsDrawFilledPolygon

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Removed 'Template:' prefix from template includings and/or changed external-link into internal-link)
Line 3: Line 3:
 
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
 
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
 
|- valign="top"
 
|- valign="top"
|'''Threat Level''' || <Threat Level goes here>
+
|'''Threat Level''' || None
 
|- valign="top"
 
|- valign="top"
 
|'''Function Syntax''' || <source lang="lsl">
 
|'''Function Syntax''' || <source lang="lsl">
Line 39: Line 39:
  
 
[[Category:OSSL Functions]]
 
[[Category:OSSL Functions]]
[[Category:OSSL functions without threat level]]
 

Revision as of 12:01, 11 June 2011

OsDrawFilledPolygon
Threat Level None
Function Syntax
LSL: string osDrawFilledPolygon( string drawList, list xpoints, list ypoints )
C# : string osDrawFilledPolygon( string drawList, LSL_List xpoints, LSL_List ypoints )
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 = osSetPenColour( CommandList, "Blue" );  
 
    // You can use either integer, float or string 
        CommandList = osDrawFilledPolygon( CommandList, [50,100,150], ["50",100,150.0] ); 
 
    // Now draw the polygon
        osSetDynamicTextureData( "", "vector", CommandList, "", 0 );
    }
}

Appends a 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.

Personal tools
General
About This Wiki