OsSetPenSize

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Quicklinks}}
+
{{osslfunc
 
+
|threat_level=None
{| width="100%" style="border: thin solid black"
+
|function_syntax=string osSetPenSize(string drawList, integer penSize)
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
+
|ossl_example=<source lang="lsl">
|- valign="top"
+
|'''Threat Level''' || <Threat Level goes here>
+
 
+
|- valign="top"
+
|'''Function Syntax''' || <source lang="lsl">
+
LSL: string osSetPenSize( string drawList, integer penSize )
+
C#: string osDrawLine( string drawList, int penSize )
+
</source>
+
|- valign="top"
+
|'''Example(s)||<source lang="lsl">
+
 
// Example of osSetPenSize
 
// Example of osSetPenSize
 
default
 
default
Line 21: Line 11:
 
         integer i;
 
         integer i;
  
         CommandList = osSetPenColour( CommandList, "Red" );        // Set the pen color to red
+
         CommandList = osSetPenColor( CommandList, "Red" );        // Set the pen color to red
 
          
 
          
 
         for (i = 1; i < 13; ++i)
 
         for (i = 1; i < 13; ++i)
Line 34: Line 24:
 
}
 
}
 
</source>
 
</source>
 
+
|description=Appends a [[Drawing commands#PenSize|PenSize]] drawing command to the string provided in '''drawList''' and returns the result.
|}
+
 
+
Appends a [[Drawing_commands#PenSize|PenSize]] drawing command to the string provided in '''drawList''' and returns the result.
+
  
 
This sets the pen size to a square of '''penSize''' pixels by '''penSize''' pixels. If '''penSize''' is an odd number, the pen will be exactly centered on the coordinates provided in the various drawing commands; if it is an even number, it will be centered slightly higher and to the left of the actual coordinates.  
 
This sets the pen size to a square of '''penSize''' pixels by '''penSize''' pixels. If '''penSize''' is an odd number, the pen will be exactly centered on the coordinates provided in the various drawing commands; if it is an even number, it will be centered slightly higher and to the left of the actual coordinates.  
 
+
|
[[Category:OSSL Functions]]
+
}}
[[Category:OSSL functions without threat level]]
+

Latest revision as of 11:40, 7 December 2018

string osSetPenSize(string drawList, integer penSize)
Appends a PenSize drawing command to the string provided in drawList and returns the result.

This sets the pen size to a square of penSize pixels by penSize pixels. If penSize is an odd number, the pen will be exactly centered on the coordinates provided in the various drawing commands; if it is an even number, it will be centered slightly higher and to the left of the actual coordinates.

Threat Level None
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
// Example of osSetPenSize
default
{
    state_entry()
    {
        string CommandList = ""; // Storage for our drawing commands
        integer i;
 
        CommandList = osSetPenColor( CommandList, "Red" );        // Set the pen color to red
 
        for (i = 1; i < 13; ++i)
        {
            CommandList = osSetPenSize( CommandList, i );                 // Set the pen size
            CommandList = osDrawLine( CommandList, 15, i*20, 241, i*20 ); // Draw a horizontal line
        }
 
        // Now draw the lines
        osSetDynamicTextureData( "", "vector", CommandList, "width:256,height:256", 0 );
    }
}
Personal tools
General
About This Wiki