Adds osDrawPolygon to OSSL. Works a little different then other OS Drawing functions, this one has no start and end point, but a number of points that will form the desired polygon. Only FilledPolygon implemented so far.

* Also added some LSL transparent type conversion, as it's done in LSL scripting (string to integer, float to string, etc)
This commit is contained in:
Arthur Valadares
2009-08-21 21:12:22 -03:00
parent 604ef5ba79
commit 7923fd29a0
5 changed files with 98 additions and 18 deletions

View File

@@ -833,6 +833,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return drawList;
}
public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y)
{
CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon");
m_host.AddScriptLPS(1);
if (x.Length != y.Length || x.Length < 3)
{
return "";
}
drawList += "FillPolygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0);
for (int i = 1; i < x.Length; i++)
{
drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i);
}
drawList += "; ";
return drawList;
}
public string osSetFontSize(string drawList, int fontSize)
{
CheckThreatLevel(ThreatLevel.None, "osSetFontSize");