public override void RenderLabel(string uniqueId, IRectangle drawingGeometry, string text, IStyle style, bool hasDropShadow, IRgbaColor dropShadowRgbaColor, float dropShadowOffsetX, float dropShadowOffsetY) { var styleToUse = (style ?? GetStyleByName("label")).ToGuiStyle(); if (hasDropShadow) { var oldColor = GUI.color; GUI.color = dropShadowRgbaColor.ToColor(); TempRect.Set( drawingGeometry.X + dropShadowOffsetX, drawingGeometry.Y + dropShadowOffsetY, drawingGeometry.Width, drawingGeometry.Height ); GUI.Label( TempRect.ToRect(), text, styleToUse ); GUI.color = oldColor; } GUI.Label( drawingGeometry.ToRect(), text, styleToUse ); }
public static Color ToColor(this IRgbaColor color) { _tempColor.r = color.R; _tempColor.g = color.G; _tempColor.b = color.B; _tempColor.a = color.A; return(_tempColor); }
public void RenderLabel(string uniqueId, IRectangle drawingGeometry, string text, IStyle style, bool hasDropShadow, IRgbaColor dropShadowRgbaColor, float dropShadowOffsetX, float dropShadowOffsetY) { Record( "RenderLabel", PrepareParam(uniqueId), PrepareParam(drawingGeometry), PrepareParam(text), PrepareParam(style), PrepareParam(hasDropShadow), PrepareParam(dropShadowRgbaColor), PrepareParam(dropShadowOffsetX), PrepareParam(dropShadowOffsetY) ); }
/// <summary> /// RgbaColors are supported /// </summary> /// <param name="para"></param> /// <returns></returns> protected object PrepareParam(IRgbaColor para) { return(para); }
public override void RenderLabel(string uniqueId, IRectangle drawingGeometry, string text, IStyle style, bool hasDropShadow, IRgbaColor dropShadowRgbaColor, float dropShadowOffsetX, float dropShadowOffsetY) { }