OsSetPenCap

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
 
(15 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]] -> [[OsSetPenCap | osSetPenCap]]
+
|threat_level=ignored
 
+
|permissions=true
ATTENTION: THIS METHOD WORKS ONLY ON WINDOWS FOR NOW. LIBGDI+ HAS A FAKE IMPLEMENTATION AND WILL NOT DRAW IT.
+
|delay=0
 
+
|function_syntax=string osSetPenCap(string drawList, string direction, string type)
LSL: '''[[string]] osSetPenCap( [[string]] drawList, string direction, string type )'''<br />
+
|ossl_example=<source lang="lsl">
C#: '''[[string]] osSetPenCap( [[string]] drawList, string direction, string type )'''
+
 
+
 
+
Appends a [[Drawing_commands#PenCap|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):
+
<p>Type:<b>
+
"arrow"
+
"diamond"
+
"round"
+
"flat"
+
</b></p>
+
<p>
+
Direction:
+
<b>
+
"start"
+
"end"
+
"both"
+
</b>
+
Example:
+
<source lang="lsl">
+
 
// Example of osSetPenCap
 
// Example of osSetPenCap
  
Line 44: Line 23:
 
}
 
}
 
</source>
 
</source>
 +
|description='''*** This method works only on Windows for now. libgdi+ has a fake implementation and will not draw it. ***'''
 +
 +
 +
Appends a [[Drawing commands#PenCap|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"
 +
|
 +
}}

Latest revision as of 10:40, 7 December 2018

string osSetPenCap(string drawList, string direction, string type)
*** This method works only on Windows for now. libgdi+ has a fake implementation and will not draw it. ***


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"
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 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 );
    }
}


Personal tools
General
About This Wiki