Example #1
0
        private static void Initialize()
        {
            //_instance.font = FontMapper.IsMapping("pixel") ? FontMapper.Get("pixel") : FontMapper.GetDefault();

            //Debug.Log("LabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(6, 8, 4, 4),
                Font      = FontMapper.GetWithFallback("pixel").Font
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;
            //_style.Font = FontMapper.GetDefault();

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black;
            _style.NormalGraphics  = new Rect(w, w, new Fill(new Color(1, 1, 1, 0)));

            _style.Commit();
        }
        private static void Initialize()
        {
            _instance.name = "PortletOverlayStyle";

            _style = new ProgramaticStyle {
                Style = _instance
            };

            //_style.Alignment = TextAnchor.MiddleCenter;

            //_style.Font = FontMapper.GetDefault();

            const int w = (Weight + 1) * 2;

            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            //_style.Padding = new RectOffset(2, 2, 2, 2);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.white;
            _style.NormalGraphics  = new Rect(w, w, new Fill(new Color(1, 1, 1, 0)), new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xbf9eff /*0xc0c0c0*//*0x214078*/).ToColor()
            });

            //_style.HoverGraphics = new Rect(w, w, new Fill(new Color(1, 1, 1, 0)), new Stroke(new Color(0.2f, 0.2f, 0.2f, 1), Weight));

            //_style.ActiveGraphics = new Rect(w, w, new Fill(new Color(1, 1, 1, 0)), new Stroke(new Color(0.1f, 0.1f, 0.1f, 1), Weight));

            _style.Commit();
        }
Example #3
0
        private static void Initialize()
        {
            //_instance.font = FontMapper.IsMapping("pixel") ? FontMapper.Get("pixel") : FontMapper.GetDefault();

            //Debug.Log("LabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(7, 7, 7, 7),
                Font      = FontMapper.GetDefault().Font,
                Border    = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1),
                //FontSize = 8,
                NormalTextColor = Color.white             // new Color(0.3f, 0.3f, 0.3f, 1f)
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;
            //_style.Font = FontMapper.GetDefault();

            //const int w = (Weight + 1)*2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;

            //_style.NormalGraphics = new Rect(w, w, new Fill(new Color(0.3f, 0.4f, 0.9f, 1f)));

            _style.Commit();
        }
        private static void Initialize()
        {
            //_instance.font = FontMapper.IsMapping("pixel") ? FontMapper.Get("pixel") : FontMapper.GetDefault();

            //Debug.Log("LabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(10, 10, 10, 10)
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;
            //_style.Font = FontMapper.GetDefault();
            //_style.Font = FontMapper.GetDefault();

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.white;
            //_style.NormalGraphics = new Rect(w, w, new Fill(RgbColor.FromHex(0x214078).ToColor())); /*new Color(0.3f, 0.3f, 0.3f, 0.85f)*/
            _style.NormalGraphics = new Rect(w, w, new Fill(ColorMixer.FromHex(0xFF0000).ToColor())); /*new Color(0.3f, 0.3f, 0.3f, 0.85f)*/

            _style.Commit();
        }
        private static void Initialize()
        {
            //Debug.Log("InspectorOverlayLabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 3, 4),
                Font      = FontMapper.GetWithFallback("pixel").Font
            };

            //_style.Font = FontMapper.GetDefault();
            //Debug.Log("Initialized * " + _style.Font);

            /*if (FontMapper.IsMapping("pixel"))
             *  _style.Font = FontMapper.Get("pixel");*/

            const int w = (Weight + 1) * 2;

            _style.Border          = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            _style.NormalTextColor = Color.white;                           // we'll tint it from outside
            _style.NormalGraphics  = new Rect(w, w, new Fill(Color.white)); // we'll tint it from outside

            _style.Commit();
        }
Example #6
0
        public static void ApplyThumbStyle(ProgramaticStyle programaticStyle, int w, int weight)
        {
            programaticStyle.Border = new RectOffset(weight + 1, weight + 1, weight + 1, weight + 1);

            //programaticStyle.FontSize = 30;
            //programaticStyle.NormalTextColor = Color.grey;
            programaticStyle.NormalGraphics = new Rect(w, w,
                                                       new Fill(NormalColor),
                                                       new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                       );
            //programaticStyle.HoverTextColor = Color.white;
            programaticStyle.HoverGraphics = new Rect(w, w,
                                                      new Fill(HoverColor),
                                                      new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                      );
            //programaticStyle.ActiveTextColor = Color.white;
            programaticStyle.ActiveGraphics = new Rect(w, w,
                                                       new Fill(ActiveColor),
                                                       new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                       );
        }
Example #7
0
        public static void ApplyBackgroundStyle(ProgramaticStyle programaticStyle, int w, int weight)
        {
            programaticStyle.Border = new RectOffset(weight + 1, weight + 1, weight + 1, weight + 1);

            //programaticStyle.FontSize = 30;
            //programaticStyle.NormalTextColor = Color.grey;
            programaticStyle.NormalGraphics = new Rect(w, w,
                                                       new Fill(BackgroundColor),
                                                       new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                       );
            //programaticStyle.HoverTextColor = Color.white;
            programaticStyle.HoverGraphics = new Rect(w, w,
                                                      new Fill(BackgroundColor),
                                                      new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                      );
            //programaticStyle.ActiveTextColor = Color.white;
            programaticStyle.ActiveGraphics = new Rect(w, w,
                                                       new Fill(BackgroundColor), //new Color(0.2f, 0.9f, 0.2f, 1f)),
                                                       new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                       );
        }
Example #8
0
        private static void Initialize()
        {
            //_instance.font = FontMapper.IsMapping("pixel") ? FontMapper.Get("pixel") : FontMapper.GetDefault();

            //Debug.Log("TooltipStyle initializer");

            _style           = new ProgramaticStyle();
            _style.Style     = _instance;
            _style.Alignment = TextAnchor.MiddleLeft;
            _style.Padding   = new RectOffset(6, 6, 4, 4);

            //_style.Font = CoreSkinMapper.Instance.System.font;
            //_style.Font = FontMapper.GetDefault();
            _style.Font = FontMapper.GetWithFallback("pixel").Font;

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black;
            _style.NormalGraphics  = new Rect(w, w, new Fill(new Color(0.9f, 0.9f, 0.3f, 1)), new Stroke(1)
            {
                Color = Color.black
            });

            _style.Commit();
        }
Example #9
0
        //private const int Weight = 2;

        private static void Initialize()
        {
            //_instance.font = FontMapper.IsMapping("pixel") ? FontMapper.Get("pixel") : FontMapper.GetDefault();

            //Debug.Log("LabelStyle initializer");

            _style = new ProgramaticStyle
            {
                Style = _instance,

                // changed from MiddleLeft on 20131006 because of the
                // button skin layout (having label left aligned because of using Left, Right..)
                // should check the AbsoluteLayout why it doesn't take horizonral and vertical align as priority
                //Alignment = TextAnchor.MiddleLeft,
                Alignment = TextAnchor.MiddleLeft,
                //Padding = new RectOffset(6, 6, 4, 4),
                Font = FontMapper.GetWithFallback("pixel").Font,
                //Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1),
                NormalTextColor = Color.white,
                TextClipping    = TextClipping.Clip // clip!
                                                    //TextClipping = TextClipping.Overflow
            };

            _style.Commit();
        }
Example #10
0
        private static void Initialize()
        {
            //Debug.Log("FormHeadingStyle initializer");

            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(10, 10, 10, 10),
                Font      = FontMapper.GetDefault().Font,
                Border    = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1),
                //FontSize = 30,
                FontStyle       = FontStyle.Italic,
                NormalTextColor = new Color(1f, 0.7f, 0f, 1)
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;

            //const int w = (Weight + 1)*2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;

            //_style.NormalGraphics = new Rect(w, w,
            //                                 new Fill(new Color(0.3f, 0.3f, 0.3f, 0.2f))
            //    );

            _style.Commit();
        }
 private static void Initialize()
 {
     const int w = (Weight + 1) * 2;
     _style = new ProgramaticStyle {Style = _instance};
     ScrollbarHelper.ApplyThumbStyle(_style, w, Weight);
     _style.Commit();
 }
        private static void Initialize()
        {
            _instance.name = "LoadingMaskBoxStyle";

            _style = new ProgramaticStyle {
                Style = _instance
            };

            //_style.Alignment = TextAnchor.MiddleCenter;

            //_style.Font = FontMapper.GetDefault();

            const int w = (Weight + 1) * 2;

            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            //_style.Padding = new RectOffset(2, 2, 2, 2);

            //_style.FontSize = 8;
            //_style.NormalTextColor = Color.white;
            _style.NormalGraphics = new Rect(w, w, new Fill(new Color(1, 1, 1, 1)),
                                             new Stroke(1)
            {
                Color = ColorMixer.FromHex(6328252).ToColor()
            });                                                                   // 6328252 = blueish, 965FFF = purple

            _style.Commit();
        }
 private static void Initialize()
 {
     _style = new ProgramaticStyle {Style = _instance};
     ScrollbarHelper.ApplyButtonStyle(_style, Width, Weight, TriangleDirection.Left);
     _style.FixedWidth = Width;
     _style.FixedHeight = Width;
     _style.Commit();
 }
Example #14
0
        private static void Initialize()
        {
            _instance.name = "PagerButtonStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font      = FontMapper.GetDefault().Font,
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 6, 6)
            };

            const int w = (Weight + 1) * 2;

            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0xC0C0C0).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0x404040).ToColor()
            }
                                              );
            _style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(new Color(1f, 1f, 1f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );
            _style.ActiveTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                              );

            _style.OnNormalTextColor = Color.white;
            _style.OnNormalGraphics  = new Rect(w, w,
                                                new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                                new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                                );

            _style.FixedHeight = 25;
            _style.FixedWidth  = 25;

            _style.Commit();
        }
Example #15
0
        private static void Initialize()
        {
            _instance.name = "CheckBoxStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font          = FontMapper.GetDefault().Font,
                Style         = _instance,
                Alignment     = TextAnchor.MiddleCenter,
                ContentOffset = new Vector2(-1, -1) // fix bad Unity offset
                                                    //Padding = new RectOffset(6, 6, 3, 3) // no GUIStyle padding
            };

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Color.white), // RgbColor.FromHex(0xC0C0C0).ToColor()
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0x404040).ToColor()
            }
                                              );
            _style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(new Color(1f, 1f, 1f, 1f)),
                                             new Stroke(Weight)
            {
                Color = Color.grey
            }
                                             );
            _style.ActiveTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0x808080).ToColor()),
                                              new Stroke(Weight)
            {
                Color = ColorMixer.FromHex(0xD3D3D3).ToColor()
            }
                                              );

            //_style.OnNormalTextColor = Color.white;
            //_style.OnNormalGraphics = new Rect(w, w,
            //                                   new Fill(RgbColor.FromHex(0x808080).ToColor()),
            //                                   new Stroke(RgbColor.FromHex(0xD3D3D3).ToColor(), Weight)
            //     );

            _style.Commit();

            //_style.FixedHeight = 20;
            //_style.FixedWidth = 100;
        }
        private static void Initialize()
        {
            const int w = (Weight + 1) * 2;

            _style = new ProgramaticStyle {
                Style = _instance
            };
            ScrollbarHelper.ApplyThumbStyle(_style, w, Weight);
            _style.Commit();
        }
 private static void Initialize()
 {
     _style = new ProgramaticStyle {
         Style = _instance
     };
     ScrollbarHelper.ApplyButtonStyle(_style, Width, Weight, TriangleDirection.Down);
     _style.FixedWidth  = Width;
     _style.FixedHeight = Width;
     _style.Commit();
 }
Example #18
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style        = _instance,
                Alignment    = TextAnchor.UpperLeft,
                Padding      = new RectOffset(6, 6, 6, 6),
                WordWrap     = true,
                TextClipping = TextClipping.Clip,
                Font         = FontMapper.GetDefault().Font
            };

            int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.Font = FontMapper.Get("pixel");
            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black; //Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              //new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(Color.white),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );
            _style.ActiveTextColor = Color.black;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            //_style.FocusedGraphics = new Rect(w, w,
            //                                  new Fill(Color.blue),
            //                                  new Stroke(Color.yellow, Weight)
            //    );

            _style.WordWrap  = true;
            _style.Alignment = TextAnchor.UpperLeft;

            _style.Commit();
        }
Example #19
0
        private static void Initialize()
        {
            _instance.name = "TabButtonStyle";
            _instance.font = FontMapper.GetDefault().Font;

            _style = new ProgramaticStyle
            {
                Font      = FontMapper.GetDefault().Font,
                Style     = _instance,
                Alignment = TextAnchor.MiddleCenter,
                Padding   = new RectOffset(6, 6, 3, 3)
            };

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.black; // Color.white;
            _style.NormalGraphics  = new Rect(w, w,
                                                  //new Fill(RgbColor.FromHex(0x965FFF).ToColor()),
                                              new Fill(ColorMixer.FromHex(0xc0c0c0).ToColor()),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            //_style.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
            //_style.HoverGraphics = new Rect(w, w,
            //                                new Fill(new Color(1f, 1f, 1f, 1f)),
            //                                new Stroke(Color.grey, Weight)
            //    );
            _style.ActiveTextColor = Color.white;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(ColorMixer.FromHex(0xA97FFF).ToColor()),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );

            //_style.OnNormalTextColor = Color.white;
            //_style.OnNormalGraphics = new Rect(w, w,
            //                                   new Fill(RgbColor.FromHex(0x808080).ToColor()),
            //                                   new Stroke(RgbColor.FromHex(0xD3D3D3).ToColor(), Weight)
            //     );

            //_style.ImagePosition = ImagePosition.ImageAbove;

            _style.ContentOffset = new Vector2(-3, 0);

            _style.Commit();
        }
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(10, 10, 4, 4),
                Font      = FontMapper.GetDefault().Font
            };

            //_style.Font = CoreSkinMapper.Instance.System.font;

            const int w = (Weight + 1) * 2;

            //_style.FixedWidth = 100;
            //_style.FixedHeight = 100;
            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            //_style.FontSize = 8;
            _style.NormalTextColor = Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(new Color(0.9f, 0.9f, 0.9f, 1f)),
                                              new Stroke(Weight)
            {
                Color = Color.grey
            }
                                              );
            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(Color.white),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );
            _style.ActiveTextColor = Color.black;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            //_style.FocusedGraphics = new Rect(w, w,
            //                                  new Fill(Color.blue),
            //                                  new Stroke(Color.yellow, Weight)
            //    );

            _style.FixedWidth  = 320;
            _style.FixedHeight = 25;

            _style.Commit();
        }
Example #21
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style           = _instance,
                Alignment       = TextAnchor.MiddleCenter,
                Font            = FontMapper.GetWithFallback("pixel").Font,
                NormalTextColor = Color.white,
                TextClipping    = TextClipping.Clip
            };

            _style.Commit();
        }
Example #22
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style = _instance
            };

            const int w = (Weight + 1) * 2;

            _style.NormalGraphics = new Rect(w, w, new Fill(Color.white));

            _style.Commit();
        }
Example #23
0
        public static void ApplyButtonStyle(ProgramaticStyle programaticStyle, int w, int weight, TriangleDirection direction)
        {
            programaticStyle.Border = new RectOffset(weight + 1, weight + 1, weight + 1, weight + 1);

            var size   = new Point(w, w);
            int pixels = w <= 20 ? 4 : 5; // the "height" of the triangle in pixels

            //programaticStyle.FontSize = 30;
            //programaticStyle.NormalTextColor = Color.grey;
            programaticStyle.NormalGraphics = new GraphicGroup(w, w,
                                                               new Rect(
                                                                   new Fill(NormalColor),
                                                                   new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                                   ),
                                                               new Triangle(new Fill(ColorMixer.FromHex(0x666666).ToColor()))
            {
                Direction = direction, Pixels = pixels
            }
                                                               );
            //programaticStyle.HoverTextColor = Color.white;
            programaticStyle.HoverGraphics = new GraphicGroup(w, w,
                                                              new Rect(
                                                                  new Fill(HoverColor),
                                                                  new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                                  ),
                                                              new Triangle(new Fill(Color.black))
            {
                Direction = direction, Pixels = pixels
            }
                                                              );
            //programaticStyle.ActiveTextColor = Color.white;
            programaticStyle.ActiveGraphics = new GraphicGroup(w, w,
                                                               new Rect(
                                                                   new Fill(ActiveColor),
                                                                   new Stroke(weight)
            {
                Color = StrokeColor
            }
                                                                   ),
                                                               new Triangle(new Fill(ColorMixer.FromHex(0x333333).ToColor()))
            {
                Direction = direction, Pixels = pixels
            }
                                                               );
        }
Example #24
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style           = _instance,
                Alignment       = TextAnchor.MiddleLeft,
                Padding         = new RectOffset(12, 12, 6, 6),
                Font            = FontMapper.Get("olney").Font,
                FontSize        = 40,
                NormalTextColor = Color.white
            };

            _style.Commit();
        }
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style = _instance
            };

            const int w = (Weight + 1) * 2;

            _style.NormalGraphics = new Rect(w, w, new Stroke(Weight));
            _style.Border         = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            _style.Commit();
        }
Example #26
0
 private GUIStyle GetLabelStyle()
 {
     if (null == _labelStyle)
     {
         _labelStyle = new GUIStyle();
         ProgramaticStyle style = new ProgramaticStyle
         {
             Style           = _labelStyle,
             Alignment       = TextAnchor.MiddleCenter,
             Font            = FontMapper.GetWithFallback("pixel").Font,
             NormalTextColor = Color.white
         };
         style.Commit();
     }
     return(_labelStyle);
 }
        private static void Initialize()
        {
            const int w = (Weight + 1) * 2;

            _style = new ProgramaticStyle
            {
                Style           = _instance,
                Alignment       = TextAnchor.MiddleCenter,
                Padding         = new RectOffset(6, 6, 3, 4),
                Font            = FontMapper.GetWithFallback("pixel").Font,
                Border          = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1),
                NormalTextColor = Color.white,                          // we'll tint it from outside
                NormalGraphics  = new Rect(w, w, new Fill(Color.white)) // we'll tint it from outside
            };

            _style.Commit();
        }
Example #28
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style     = _instance,
                Alignment = TextAnchor.MiddleLeft,
                Padding   = new RectOffset(6, 6, 4, 4),
                Font      = FontMapper.GetWithFallback("pixel").Font
            };

            const int w = (Weight + 1) * 2;

            _style.Border          = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
            _style.NormalTextColor = Color.white;
            _style.NormalGraphics  = new Rect(w, w, new Fill(ColorMixer.FromHex(0x1261c1).ToColor()));

            _style.Commit();
        }
Example #29
0
        private static GUIStyle GetShineStyle()
        {
            if (null == _shineStyle)
            {
                _shineStyle = new GUIStyle();

                ProgramaticStyle style = new ProgramaticStyle
                {
                    Style          = _shineStyle,
                    Alignment      = TextAnchor.MiddleCenter,
                    NormalGraphics = new Rect(1, 1, new Fill(Color.white))
                };

                style.Commit();
            }

            return(_shineStyle);
        }
Example #30
0
        private static void Initialize()
        {
            _style = new ProgramaticStyle
            {
                Style        = _instance,
                Alignment    = TextAnchor.MiddleLeft,
                Padding      = new RectOffset(6, 6, 6, 6),
                Font         = FontMapper.GetWithFallback("pixel").Font,
                TextClipping = TextClipping.Clip
            };

            int w = (Weight + 1) * 2;

            _style.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);

            _style.NormalTextColor = Color.black; //Color.grey;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );
            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(Color.white),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );
            _style.ActiveTextColor = Color.black;
            _style.ActiveGraphics  = new Rect(w, w,
                                              new Fill(Color.white),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );

            _style.Commit();
        }
        private static void Initialize()
        {
            _style = new ProgramaticStyle {
                Style = _instance
            };

            int w = (BorderWidth + 1) * 2;

            _style.Border = new RectOffset(BorderWidth + 1, BorderWidth + 1, BorderWidth + 1, BorderWidth + 1);

            _style.NormalGraphics = new Rect(w, w,
                                             new Fill(new Color(0.9f, 0.9f, 0.9f, 0)), // transparent fill!
                                             new Stroke(BorderWidth)
            {
                Color = BorderColor
            }
                                             );

            _style.Commit();
        }
Example #32
0
        private static void Initialize()
        {
            _instance.name = "OnePxBorderStyle";

            _style = new ProgramaticStyle {
                Style = _instance
            };

            var border = new BorderMetrics(1); // 1px border
            var w      = border.GetRenderingWidth();
            var h      = border.GetRenderingHeight();

            //Debug.Log("w: " + w + ", h:" + h);

            _style.Border         = border.ToGUIStyleBorder();
            _style.NormalGraphics = new Rect(w, h, new Stroke(border)
            {
                Color = Color.white
            });
            _style.Commit();
        }