osSetPenColor

osSetPenColor1

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
This commit is contained in:
Jeff Kelley
2023-05-05 07:12:08 +00:00
committed by UbitUmarov
parent f670a3aa51
commit b96ef0d00c
4 changed files with 57 additions and 1 deletions

View File

@@ -1413,6 +1413,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return drawList;
}
public string osSetPenColor(string drawList, LSL_Types.Vector3 color)
{
CheckThreatLevel();
return osSetPenColor(drawList, color, (LSL_Float)1.0);
}
public string osSetPenColor(string drawList, LSL_Types.Vector3 color, LSL_Float alpha)
{
CheckThreatLevel() ;
int argbA = (int) (Util.Clamp ((float)alpha, 0f, 1f) * 255f);
int argbR = (int) (Util.Clamp ((float)color.x, 0f, 1f) * 255f);
int argbG = (int) (Util.Clamp ((float)color.y, 0f, 1f) * 255f);
int argbB = (int) (Util.Clamp ((float)color.z, 0f, 1f) * 255f);
StringBuilder hexColorBuilder = new StringBuilder();
hexColorBuilder.Append(argbA.ToString("X2"));
hexColorBuilder.Append(argbR.ToString("X2"));
hexColorBuilder.Append(argbG.ToString("X2"));
hexColorBuilder.Append(argbB.ToString("X2"));
return osSetPenColor(drawList, hexColorBuilder.ToString());
}
// Deprecated
public string osSetPenColour(string drawList, string colour)
{

View File

@@ -243,6 +243,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osSetFontSize(string drawList, int fontSize);
string osSetPenSize(string drawList, int penSize);
string osSetPenColor(string drawList, string color);
string osSetPenColor(string drawList, LSL_Types.Vector3 color);
string osSetPenColor(string drawList, LSL_Types.Vector3 color, LSL_Float alpha);
string osSetPenColour(string drawList, string colour); // Deprecated
string osSetPenCap(string drawList, string direction, string type);
string osDrawImage(string drawList, int width, int height, string imageUrl);

View File

@@ -515,6 +515,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osSetPenColor(drawList, color);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string osSetPenColor(string drawList, vector color)
{
return m_OSSL_Functions.osSetPenColor(drawList, color);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string osSetPenColor(string drawList, vector color, float alpha)
{
return m_OSSL_Functions.osSetPenColor(drawList, color, alpha);
}
// Deprecated
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string osSetPenColour(string drawList, string colour)