OsDrawPolygon
From OpenSimulator
(Difference between revisions)
m |
|||
Line 13: | Line 13: | ||
state_entry() | state_entry() | ||
{ | { | ||
− | + | // Storage for our drawing commands | |
− | + | string CommandList = ""; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | // "PenSize 3;" | ||
+ | CommandList = osSetPenSize( CommandList, 3 ); | ||
+ | // "PenColor Blue;" | ||
+ | CommandList = osSetPenColor( CommandList, "Blue" ); | ||
+ | // "Polygon 128,20,20,186,236,186;" | ||
+ | CommandList = osDrawPolygon( CommandList, [128,20,236], [20,186,186] ); | ||
− | + | // "PenColor Green;" | |
− | + | CommandList = osSetPenColor( CommandList, "Green" ); | |
− | + | // "Polygon 128,236,20,70,236,70;" | |
− | + | CommandList = osDrawPolygon( CommandList, [128,20,236], [236,70,70] ); | |
− | + | ||
− | + | // "PenSize 5;" | |
− | + | CommandList = osSetPenSize( CommandList, 5 ); | |
− | + | // "PenColor Red;" | |
− | + | CommandList = osSetPenColor( CommandList, "Red" ); | |
− | + | // "Polygon 20,20,236,20,236,236,20,236;" | |
− | + | CommandList = osDrawPolygon( CommandList, [20,236,236,20], [20,20,236,236] ); | |
− | + | ||
− | + | // Now draw the polygon | |
− | + | osSetDynamicTextureData( "", "vector", CommandList, "", 0 ); | |
} | } | ||
− | } | + | }</source> |
− | </source> | + | The result will be like that: |
− | The result will be | + | |
[[Image:OsDrawPolygonSample.png|200px]] | [[Image:OsDrawPolygonSample.png|200px]] | ||
| | | |
Revision as of 07:40, 24 June 2011
LSL: string osDrawPolygon( string drawList, list xpoints, list ypoints ) C#: string osDrawPolygon( string drawList, LSL_List xpoints, LSL_List ypoints ) | |
No descriptions provided | |
Threat Level | None |
Permissions | No permissions specified |
Extra Delay | No function delay specified |
Example(s) | |
// Example of osDrawPolygon default { state_entry() { // Storage for our drawing commands string CommandList = ""; // "PenSize 3;" CommandList = osSetPenSize( CommandList, 3 ); // "PenColor Blue;" CommandList = osSetPenColor( CommandList, "Blue" ); // "Polygon 128,20,20,186,236,186;" CommandList = osDrawPolygon( CommandList, [128,20,236], [20,186,186] ); // "PenColor Green;" CommandList = osSetPenColor( CommandList, "Green" ); // "Polygon 128,236,20,70,236,70;" CommandList = osDrawPolygon( CommandList, [128,20,236], [236,70,70] ); // "PenSize 5;" CommandList = osSetPenSize( CommandList, 5 ); // "PenColor Red;" CommandList = osSetPenColor( CommandList, "Red" ); // "Polygon 20,20,236,20,236,236,20,236;" CommandList = osDrawPolygon( CommandList, [20,236,236,20], [20,20,236,236] ); // Now draw the polygon osSetDynamicTextureData( "", "vector", CommandList, "", 0 ); } } | |
Notes | |
*Appends a Polygon drawing command to the string provided in drawList and returns the result.
|