OsDrawFilledPolygon: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>Arthursv
New page: {{Template:Quicklinks}} Technical Reference -> Terms -> Status Page -> [[OSSL_Implemented| OSSL Implemented Functions...
 
imported>Arthursv
No edit summary
Line 13: Line 13:
Example:
Example:
<source lang="lsl">
<source lang="lsl">
// Example of osDrawPolygon
// Example of osDrawFilledPolygon
default
default
{
{

Revision as of 21:19, 28 August 2009

Technical Reference -> Terms -> Status Page -> OSSL Implemented Functions -> Dynamic textures -> osDrawFilledPolygon


LSL: string osDrawFilledPolygon( string drawList, list xpoints, list ypoints )
C#: string osDrawFilledPolygon( string drawList, LSL_List xpoints, LSL_List ypoints )


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.

Example:

// Example of osDrawFilledPolygon
default
{
    state_entry()
    {
        string CommandList = ""; // Storage for our drawing commands

        CommandList = osSetPenSize( CommandList, 3 );         // Set the pen width to 3 pixels
        CommandList = osSetPenColour( CommandList, "Blue" );  // Set the pen color to blue
        CommandList = osDrawFilledPolygon( CommandList, [50,100,150], ["50",100,150.0] ); // You can use either integer, float or string 

        // Now draw the polygon
        osSetDynamicTextureData( "", "vector", CommandList, "", 0 );
    }
}