OsSetPenCap: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>Arthursv
No edit summary
imported>Arthursv
No edit summary
Line 11: Line 11:


This sets the pen's start or/and end cap to either "diamond", "arrow", "round", or default "flat" shape. It can set them in the "end" or "start" of the line, or "both". Possible values are (case insensitive):
This sets the pen's start or/and end cap to either "diamond", "arrow", "round", or default "flat" shape. It can set them in the "end" or "start" of the line, or "both". Possible values are (case insensitive):
<p>Type:
<p>Type:<b>
"arrow"
"arrow"
"diamond"
"diamond"
"round"
"round"
"flat"
"flat"
 
</b></p>
<p><b>
Direction:
Direction:
"start"
"start"
"end"
"end"
"both"
"both"
 
</b>
Example:
Example:
<source lang="lsl">
<source lang="lsl">

Revision as of 21:28, 28 August 2009

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

ATTENTION: THIS METHOD WORKS ONLY ON WINDOWS FOR NOW. LIBGDI+ HAS A FAKE IMPLEMENTATION AND WILL NOT DRAW IT.

LSL: string osSetPenCap( string drawList, string direction, string type )
C#: string osSetPenCap( string drawList, string direction, string type )


Appends a PenCap drawing command to the string provided in drawList and returns the result.

This sets the pen's start or/and end cap to either "diamond", "arrow", "round", or default "flat" shape. It can set them in the "end" or "start" of the line, or "both". Possible values are (case insensitive):

Type: "arrow" "diamond" "round" "flat"

Direction: "start" "end" "both" Example:

// Example of osSetPenCap

default
{
    state_entry()
    {
        string CommandList = "";                              // Storage for our drawing commands
        integer i;

        CommandList = osSetPenSize( CommandList, 5 );         // Set the pen width to 5 pixels. With 1 pixel, arrow is very hard to see
        CommandList = osSetPenCap("start", "arrow");          // Sets the beggining of the line with an arrow
        CommandList = osMovePen(drawList,50,100);             // Moves pen to 50,100
        CommandList = osLineTo(drawList, 100,150);            // Draws line from 50,100 to 100,150

        osSetDynamicTextureData( "", "vector", CommandList, "", 0 );
    }
}