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
                );
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 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)
         );
 }
Exemple #4
0
 /// <summary>
 /// RgbaColors are supported
 /// </summary>
 /// <param name="para"></param>
 /// <returns></returns>
 protected object PrepareParam(IRgbaColor para)
 {
     return(para);
 }
Exemple #5
0
 public override void RenderLabel(string uniqueId, IRectangle drawingGeometry, string text, IStyle style, bool hasDropShadow,
                                  IRgbaColor dropShadowRgbaColor, float dropShadowOffsetX, float dropShadowOffsetY)
 {
 }