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()
        {
            //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()
        {
            //_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();
        }
Beispiel #4
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();
        }
Beispiel #5
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()
        {
            //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();
        }
Beispiel #7
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();
        }
        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();
        }
Beispiel #9
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();
        }
        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();
        }
 private static void Initialize()
 {
     _style = new ProgramaticStyle {Style = _instance};
     ScrollbarHelper.ApplyButtonStyle(_style, Width, Weight, TriangleDirection.Left);
     _style.FixedWidth = Width;
     _style.FixedHeight = Width;
     _style.Commit();
 }
Beispiel #12
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();
        }
Beispiel #13
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()
 {
     _style = new ProgramaticStyle {
         Style = _instance
     };
     ScrollbarHelper.ApplyButtonStyle(_style, Width, Weight, TriangleDirection.Down);
     _style.FixedWidth  = Width;
     _style.FixedHeight = Width;
     _style.Commit();
 }
        private static void Initialize()
        {
            const int w = (Weight + 1) * 2;

            _style = new ProgramaticStyle {
                Style = _instance
            };
            ScrollbarHelper.ApplyThumbStyle(_style, w, Weight);
            _style.Commit();
        }
Beispiel #16
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();
        }
Beispiel #17
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();
        }
Beispiel #19
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();
        }
Beispiel #20
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();
        }
        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();
        }
Beispiel #22
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();
        }
Beispiel #23
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();
        }
Beispiel #25
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();
        }
Beispiel #26
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);
        }
Beispiel #27
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();
        }
Beispiel #29
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();
        }
Beispiel #30
0
        private static void Initialize()
        {
            _instance.name = "GreenButtonStyle";
            _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;
            _style.NormalGraphics  = new Rect(w, w,
                                              new Fill(Green),
                                              new Stroke(Weight)
            {
                Color = Color.black
            }
                                              );

            _style.HoverTextColor = Color.black;
            _style.HoverGraphics  = new Rect(w, w,
                                             new Fill(ColorMixer.FromHex(0x14FF99).ToColor()),
                                             new Stroke(Weight)
            {
                Color = Color.black
            }
                                             );

            _style.Commit();
        }
Beispiel #31
0
        private static void Initialize()
        {
            _instance.name = "PanelBackgroundStyle";

            _style = new ProgramaticStyle {
                Style = _instance, 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(RgbColor.FromHex(0xBBD4F6).ToColor())/*, new Stroke(Color.grey, Weight)*/); //new Color(1, 1, 1, 1)
            _style.NormalGraphics = new Rect(w, w, new Fill(new Color(1, 1, 1, 1)));

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

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

            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 = new Color(0.85f, 0.85f, 0.85f, 1);
            _style.NormalGraphics  = new Rect(w, w, new Fill(new Color(1, 1, 1, 1)) /*, new Stroke(Color.grey, Weight)*/);

            _style.Commit();
        }