mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
osSetPenColor
osSetPenColor1 Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user