示例#1
0
        protected override void DrawStyle(Style style, float opacity)
        {
            base.DrawStyle(style, opacity);

            int texture = Gui.Renderer.GetTexture(Texture);

            if (texture < 0)
            {
                return;
            }

            if (ColorByTint)
            {
                Color = style.Tint;
            }

            int color = Color;

            if (Tint != -1)
            {
                color = ColorInt.Blend(Tint, color);
            }

            color = ColorInt.FromArgb(opacity, color);

            if (TextureRect.IsEmpty())
            {
                Point texsize = Gui.Renderer.GetTextureSize(texture);
                TextureRect = new Rectangle(Point.Zero, texsize);
            }

            //bool atlas = SpriteBatch.AutoAtlas;

            //if (ExcludeFromAtlas)
            //    SpriteBatch.AutoAtlas = false;

            if (Tiling == TextureMode.Grid || Tiling == TextureMode.GridRepeat)
            {
                SliceTexture(texture, Tiling, TextureRect, Grid, opacity, color);
            }
            else if (Tiling == TextureMode.Stretch)
            {
                Gui.Renderer.DrawTexture(texture, Location.x + Inset.Left, Location.y + Inset.Top, Size.x - (Inset.Left + Inset.Right), Size.y - (Inset.Top + Inset.Bottom), TextureRect, color);
            }
            else if (Tiling == TextureMode.Center)
            {
                Point center   = Location + Size / 2;
                Point rectsize = new Point(TextureRect.Width, TextureRect.Height);
                Point pos      = center - rectsize / 2;

                Gui.Renderer.DrawTexture(texture, pos.x, pos.y, rectsize.x, rectsize.y, TextureRect, color);
            }
            else
            {
                RepeatTexture(texture, Location, TextureRect, Tiling, opacity, color);
            }

            //if (ExcludeFromAtlas)
            //    SpriteBatch.AutoAtlas = atlas;
        }
示例#2
0
文件: Label.cs 项目: hershesz/Squid
        protected override void DrawText(Style style, float opacity)
        {
            if (IsDirty)
            {
                UpdateText(style);
            }

            if (Lines.Count == 0)
            {
                return;
            }

            int   font;
            Point p1, p2, size;

            foreach (TextLine line in Lines)
            {
                foreach (TextElement element in line.Elements)
                {
                    if (element.Linebreak)
                    {
                        continue;
                    }

                    font = Gui.Renderer.GetFont(element.Font);
                    size = element.Size;
                    p2   = element.Position + Location;

                    element.Rectangle = new Rectangle(p2, size);

                    if (!element.Rectangle.Intersects(ClipRect))
                    {
                        continue;
                    }

                    if (element.IsControl)
                    {
                        continue;
                    }

                    if (element.IsLink)
                    {
                        Gui.Renderer.DrawBox(p2.x, p2.y + size.y, size.x - 1, 1, ColorInt.FromArgb(opacity, ColorInt.FromArgb(opacity, element.Color.HasValue ? (int)element.Color : style.TextColor)));
                    }

                    //if (element.IsLink && element.Href == ActiveHref)
                    //    Gui.Renderer.DrawBox(p2.x, p2.y, size.x - 1, size.y, ColorInt.FromArgb(opacity, LinkColor));

                    if (UseTextColor)
                    {
                        Gui.Renderer.DrawText(element.Text, p2.x, p2.y, font, ColorInt.FromArgb(opacity, TextColor));
                    }
                    else
                    {
                        Gui.Renderer.DrawText(element.Text, p2.x, p2.y, font, ColorInt.FromArgb(opacity, element.Color.HasValue ? (int)element.Color : style.TextColor));
                    }
                }
            }
        }
示例#3
0
文件: Label.cs 项目: hershesz/Squid
 /// <summary>
 /// Initializes a new instance of the <see cref="Label"/> class.
 /// </summary>
 public Label()
 {
     AutoEllipsis  = true;
     TextAlign     = Alignment.Inherit;
     Style         = "label";
     LinkColor     = ColorInt.ARGB(.25f, 1f, 1f, 1f);
     TextColor     = -1;
     BBCodeEnabled = false;
     MouseClick   += Label_MouseClick;
 }
示例#4
0
        protected override void DrawBefore()
        {
            if (Modal)
            {
                SetScissor(0, 0, Desktop.Size.x, Desktop.Size.y);
                Gui.Renderer.DrawBox(0, 0, Desktop.Size.x, Desktop.Size.y, ColorInt.FromArgb(GetOpacity(1), Desktop.ModalColor));
                ResetScissor();
            }

            base.DrawBefore();
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextArea"/> class.
        /// </summary>
        public TextArea()
        {
            LinkColor      = -1;
            TextColor      = -1;
            BlinkColor     = -1;
            BlinkInterval  = 500;
            SelectionColor = ColorInt.ARGB(.5f, 1, 1, 1);

            Style      = "textbox";
            Cursor     = CursorNames.Select;
            Size       = new Point(100, 60);
            TextAlign  = Alignment.TopLeft;
            AllowFocus = true;

            MouseDown        += TextBox_MouseDown;
            MousePress       += TextBox_MousePress;
            MouseDoubleClick += TextBox_MouseDoubleClick;
            LostFocus        += TextBox_LostFocus;
            GotFocus         += TextBox_GotFocus;
        }
示例#6
0
        /// <summary>
        /// generates a standard skin
        /// this is only used for sample purposes
        /// </summary>
        /// <returns></returns>
        public static Skin GenerateStandardSkin()
        {
            var baseStyle = new ControlStyle
            {
                Tiling  = TextureMode.Grid,
                Grid    = new Margin(3),
                Texture = "button_hot.dds"
            };

            baseStyle.Default.Texture         = "button_default.dds";
            baseStyle.Pressed.Texture         = "button_down.dds";
            baseStyle.SelectedPressed.Texture = "button_down.dds";
            baseStyle.Focused.Texture         = "button_down.dds";
            baseStyle.SelectedFocused.Texture = "button_down.dds";
            baseStyle.Selected.Texture        = "button_down.dds";
            baseStyle.SelectedHot.Texture     = "button_down.dds";

            var itemStyle = new ControlStyle(baseStyle)
            {
                TextPadding = new Margin(10, 0, 0, 0),
                TextAlign   = Alignment.MiddleLeft
            };

            var buttonStyle = new ControlStyle(baseStyle)
            {
                TextPadding = new Margin(0),
                TextAlign   = Alignment.MiddleCenter
            };

            var tooltipStyle = new ControlStyle(buttonStyle)
            {
                TextPadding = new Margin(8),
                TextAlign   = Alignment.TopLeft
            };

            var inputStyle = new ControlStyle
            {
                Texture = "input_default.dds"
            };

            inputStyle.Hot.Texture     = "input_focused.dds";
            inputStyle.Focused.Texture = "input_focused.dds";
            inputStyle.TextPadding     = new Margin(8);
            inputStyle.Tiling          = TextureMode.Grid;
            inputStyle.Focused.Tint    = ColorInt.ARGB(1, 0, 0, 1);
            inputStyle.Grid            = new Margin(3);

            var windowStyle = new ControlStyle
            {
                Tiling  = TextureMode.Grid,
                Grid    = new Margin(9),
                Texture = "window.dds"
            };

            var frameStyle = new ControlStyle
            {
                Tiling      = TextureMode.Grid,
                Grid        = new Margin(4),
                Texture     = "frame.dds",
                TextPadding = new Margin(8)
            };

            var vscrollTrackStyle = new ControlStyle
            {
                Tiling  = TextureMode.Grid,
                Grid    = new Margin(3),
                Texture = "vscroll_track.dds"
            };

            var vscrollButtonStyle = new ControlStyle
            {
                Tiling  = TextureMode.Grid,
                Grid    = new Margin(3),
                Texture = "vscroll_button.dds"
            };

            vscrollButtonStyle.Hot.Texture     = "vscroll_button_hot.dds";
            vscrollButtonStyle.Pressed.Texture = "vscroll_button_down.dds";

            var vscrollUp = new ControlStyle();

            vscrollUp.Default.Texture = "vscrollUp_default.dds";
            vscrollUp.Hot.Texture     = "vscrollUp_hot.dds";
            vscrollUp.Pressed.Texture = "vscrollUp_down.dds";
            vscrollUp.Focused.Texture = "vscrollUp_hot.dds";

            var hscrollTrackStyle = new ControlStyle
            {
                Tiling  = TextureMode.Grid,
                Grid    = new Margin(3),
                Texture = "hscroll_track.dds"
            };

            var hscrollButtonStyle = new ControlStyle
            {
                Tiling  = TextureMode.Grid,
                Grid    = new Margin(3),
                Texture = "hscroll_button.dds"
            };

            hscrollButtonStyle.Hot.Texture     = "hscroll_button_hot.dds";
            hscrollButtonStyle.Pressed.Texture = "hscroll_button_down.dds";

            var hscrollUp = new ControlStyle();

            hscrollUp.Default.Texture = "hscrollUp_default.dds";
            hscrollUp.Hot.Texture     = "hscrollUp_hot.dds";
            hscrollUp.Pressed.Texture = "hscrollUp_down.dds";
            hscrollUp.Focused.Texture = "hscrollUp_hot.dds";

            var checkButtonStyle = new ControlStyle();

            checkButtonStyle.Default.Texture        = "checkbox_default.dds";
            checkButtonStyle.Hot.Texture            = "checkbox_hot.dds";
            checkButtonStyle.Pressed.Texture        = "checkbox_down.dds";
            checkButtonStyle.Checked.Texture        = "checkbox_checked.dds";
            checkButtonStyle.CheckedFocused.Texture = "checkbox_checked_hot.dds";
            checkButtonStyle.CheckedHot.Texture     = "checkbox_checked_hot.dds";
            checkButtonStyle.CheckedPressed.Texture = "checkbox_down.dds";

            var comboLabelStyle = new ControlStyle
            {
                TextPadding = new Margin(10, 0, 0, 0)
            };

            comboLabelStyle.Default.Texture = "combo_default.dds";
            comboLabelStyle.Hot.Texture     = "combo_hot.dds";
            comboLabelStyle.Pressed.Texture = "combo_down.dds";
            comboLabelStyle.Focused.Texture = "combo_hot.dds";
            comboLabelStyle.Tiling          = TextureMode.Grid;
            comboLabelStyle.Grid            = new Margin(3, 0, 0, 0);

            var comboButtonStyle = new ControlStyle();

            comboButtonStyle.Default.Texture = "combo_button_default.dds";
            comboButtonStyle.Hot.Texture     = "combo_button_hot.dds";
            comboButtonStyle.Pressed.Texture = "combo_button_down.dds";
            comboButtonStyle.Focused.Texture = "combo_button_hot.dds";

            var labelStyle = new ControlStyle
            {
                TextAlign   = Alignment.TopLeft,
                TextPadding = new Margin(8)
            };

            var skin = new Skin
            {
                { "item", itemStyle },
                { "textbox", inputStyle },
                { "button", buttonStyle },
                { "window", windowStyle },
                { "frame", frameStyle },
                { "checkBox", checkButtonStyle },
                { "comboLabel", comboLabelStyle },
                { "comboButton", comboButtonStyle },
                { "vscrollTrack", vscrollTrackStyle },
                { "vscrollButton", vscrollButtonStyle },
                { "vscrollUp", vscrollUp },
                { "hscrollTrack", hscrollTrackStyle },
                { "hscrollButton", hscrollButtonStyle },
                { "hscrollUp", hscrollUp },
                { "multiline", labelStyle },
                { "tooltip", tooltipStyle }
            };

            return(skin);
        }
示例#7
0
文件: TextBox.cs 项目: hershesz/Squid
        protected override void DrawText(Style style, float opacity)
        {
            if (_text == null)
            {
                _text = string.Empty;
            }

            string masked = _text;

            if (IsPassword)
            {
                masked = new string(PasswordChar, masked.Length);
            }

            int font = Gui.Renderer.GetFont(style.Font);

            if (font < 0)
            {
                return;
            }

            Point p = AlignText(masked, Alignment.MiddleLeft, style.TextPadding, font);

            Rectangle clip = new Rectangle(Location, Size);

            clip.Left  += style.TextPadding.Left;
            clip.Right -= style.TextPadding.Right - 1;
            clip        = Clip(clip);

            if (clip.Width < 1 || clip.Height < 1)
            {
                return;
            }

            SetScissor(clip.Left, clip.Top, clip.Width, clip.Height);

            if (Caret > masked.Length)
            {
                Caret = masked.Length;
            }

            if (Desktop.FocusedControl == this)
            {
                Rectangle rect = new Rectangle(Location, Size);

                Point s1 = Gui.Renderer.GetTextSize(masked, font);
                Point s2 = Gui.Renderer.GetTextSize(masked.Substring(0, Caret), font);

                if (string.IsNullOrEmpty(masked))
                {
                    s2.y = Gui.Renderer.GetTextSize(" ", font).y;
                    p    = AlignText(" ", Alignment.MiddleLeft, style.TextPadding, font);
                }
                else if (s2.y == 0)
                {
                    s2.y = Gui.Renderer.GetTextSize(" ", font).y;
                }

                int carex = p.x + Offset + s2.x;

                int lim1 = rect.Left + style.TextPadding.Left;
                int lim2 = rect.Right - style.TextPadding.Right;

                if (carex < lim1)
                {
                    Offset += lim1 - carex;
                }

                if (carex > lim2)
                {
                    Offset += lim2 - carex;
                }

                if (Offset < 0)
                {
                    if (p.x + Offset + s1.x < lim2)
                    {
                        Offset += lim2 - (p.x + Offset + s1.x);
                    }
                }

                p.x += Offset;

                Gui.Renderer.DrawText(masked, p.x, p.y, font, ColorInt.FromArgb(opacity, UseTextColor ? TextColor : style.TextColor));

                if (!ReadOnly && DoBlink > 0)
                {
                    Gui.Renderer.DrawBox(p.x + s2.x, p.y, 1, s2.y, ColorInt.FromArgb(opacity, BlinkColor));
                }

                if (IsSelection)
                {
                    int    start = Math.Min(SelectStart, SelectEnd);
                    int    end   = Math.Max(SelectStart, SelectEnd);
                    int    color = ColorInt.FromArgb(0.5f, SelectionColor);
                    string text  = masked.Substring(0, start);
                    string text2 = masked.Substring(start, end - start);

                    Point size1 = Gui.Renderer.GetTextSize(text, font);
                    Point size2 = Gui.Renderer.GetTextSize(text2, font);

                    Gui.Renderer.DrawBox(p.x + size1.x, p.y, size2.x, size2.y, ColorInt.FromArgb(opacity, color));
                }
            }
            else
            {
                HasFocus = false;
                Offset   = 0;
                Gui.Renderer.DrawText(masked, p.x, p.y, font, ColorInt.FromArgb(opacity, style.TextColor));
            }

            ResetScissor();
        }
示例#8
0
        protected override void DrawText(Style style, float opacity)
        {
            if (IsDirty)
            {
                UpdateText(style);
            }

            int       font;
            int       total = 0;
            int       numLine = 0;
            Point     p1, p2, size;
            Alignment align     = TextAlign != Alignment.Inherit ? TextAlign : style.TextAlign;
            bool      drawCaret = HasFocus && DoBlink > 0;

            if (Lines.Count == 0)
            {
                if (drawCaret)
                {
                    p1   = Location;
                    font = Gui.Renderer.GetFont(style.Font);

                    if (align == Alignment.TopLeft || align == Alignment.TopCenter || align == Alignment.TopRight)
                    {
                        p1.y += style.TextPadding.Top;
                    }

                    if (align == Alignment.BottomLeft || align == Alignment.BottomCenter || align == Alignment.BottomRight)
                    {
                        p1.y += Size.y - TextSize.y;
                    }

                    if (align == Alignment.MiddleLeft || align == Alignment.MiddleCenter || align == Alignment.MiddleRight)
                    {
                        p1.y += (Size.y - (TextSize.y - (style.TextPadding.Top + style.TextPadding.Bottom))) / 2;
                    }

                    if (align == Alignment.TopLeft || align == Alignment.MiddleLeft || align == Alignment.BottomLeft)
                    {
                        p1.x += style.TextPadding.Left;
                    }

                    if (align == Alignment.TopRight || align == Alignment.MiddleRight || align == Alignment.BottomRight)
                    {
                        p1.x += Size.x - style.TextPadding.Right;
                    }

                    if (align == Alignment.TopCenter || align == Alignment.MiddleCenter || align == Alignment.BottomCenter)
                    {
                        p1.x += Size.x / 2;
                    }

                    Point subsize = Gui.Renderer.GetTextSize(" ", font);
                    Gui.Renderer.DrawBox(p1.x, p1.y, 2, subsize.y, ColorInt.FromArgb(opacity, BlinkColor));
                }

                return;
            }

            foreach (TextLine line in Lines)
            {
                int perline = 0;

                foreach (TextElement element in line.Elements)
                {
                    //if (element.Linebreak)
                    //    continue;

                    font = Gui.Renderer.GetFont(element.Font);

                    if (element.Linebreak)
                    {
                        total++;
                    }
                    else
                    {
                        total += element.Text.Length;
                    }

                    size = element.Size;
                    p1   = Location;

                    if (align == Alignment.TopLeft || align == Alignment.TopCenter || align == Alignment.TopRight)
                    {
                        p1.y += style.TextPadding.Top;
                    }

                    if (align == Alignment.BottomLeft || align == Alignment.BottomCenter || align == Alignment.BottomRight)
                    {
                        p1.y += Size.y - TextSize.y;
                    }

                    if (align == Alignment.MiddleLeft || align == Alignment.MiddleCenter || align == Alignment.MiddleRight)
                    {
                        p1.y += (Size.y - (TextSize.y - (style.TextPadding.Top + style.TextPadding.Bottom))) / 2;
                    }

                    if (align == Alignment.TopLeft || align == Alignment.MiddleLeft || align == Alignment.BottomLeft)
                    {
                        p1.x += style.TextPadding.Left;
                    }

                    if (align == Alignment.TopRight || align == Alignment.MiddleRight || align == Alignment.BottomRight)
                    {
                        p1.x += Size.x - line.Width - style.TextPadding.Right;
                    }

                    if (align == Alignment.TopCenter || align == Alignment.MiddleCenter || align == Alignment.BottomCenter)
                    {
                        p1.x += (Size.x - line.Width) / 2;
                    }

                    p2 = element.Position + p1;

                    element.Rectangle = new Rectangle(p2, size);

                    if (element.IsLink && element.Href == ActiveHref)
                    {
                        Gui.Renderer.DrawBox(p2.x, p2.y, size.x - 1, size.y, ColorInt.FromArgb(opacity, LinkColor));
                    }

                    if (drawCaret && total >= Caret)
                    {
                        drawCaret = false;

                        if (string.IsNullOrEmpty(element.Text))
                        {
                            Point subsize = Gui.Renderer.GetTextSize(" ", font);
                            Gui.Renderer.DrawBox(p2.x, p2.y, 2, subsize.y, ColorInt.FromArgb(opacity, BlinkColor));
                        }
                        else
                        {
                            string substr = element.Text.Substring(0, element.Text.Length - (total - Caret));

                            if (string.IsNullOrEmpty(substr))
                            {
                                Point subsize = Gui.Renderer.GetTextSize(" ", font);
                                Gui.Renderer.DrawBox(p2.x, p2.y, 2, subsize.y, ColorInt.FromArgb(opacity, BlinkColor));
                            }
                            else
                            {
                                Point subsize = Gui.Renderer.GetTextSize(substr, font);
                                Gui.Renderer.DrawBox(p2.x + subsize.x, p2.y, 2, subsize.y, ColorInt.FromArgb(opacity, BlinkColor));
                            }
                        }
                    }

                    if (UseTextColor)
                    {
                        Gui.Renderer.DrawText(element.Text, p2.x, p2.y, font, ColorInt.FromArgb(opacity, TextColor));
                    }
                    else
                    {
                        Gui.Renderer.DrawText(element.Text, p2.x, p2.y, font, ColorInt.FromArgb(opacity, element.Color.HasValue ? (int)element.Color : style.TextColor));
                    }

                    //    Gui.Renderer.DrawBox(element.Rectangle.Left, element.Rectangle.Top, element.Rectangle.Width, element.Rectangle.Height, -1);

                    if (IsSelection && total >= SelectionStart && perline < SelectionEnd && !element.Linebreak)
                    {
                        int start = SelectionStart;
                        int end   = SelectionEnd;
                        int color = ColorInt.FromArgb(0.5f, -1);

                        //int origin = perline - element.Text.Length;
                        //start = Math.Max(0, origin - start);

                        //if (string.IsNullOrEmpty(element.Text))
                        //{
                        //    Point subsize = Gui.Renderer.GetTextSize(" ", font);
                        //    Gui.Renderer.DrawBox(p2.x, p2.y, subsize.x, subsize.y, ColorInt.FromArgb(opacity, BlinkColor));
                        //}
                        //else
                        //{
                        int begin = element.Text.Length - (total - start);
                        if (begin < 0)
                        {
                            begin = 0;
                        }

                        int len = element.Text.Length - begin - (total - end);
                        if (len < 0)
                        {
                            len = 0;
                        }
                        if (len > element.Text.Length)
                        {
                            len = element.Text.Length;
                        }
                        if (begin + len > element.Text.Length)
                        {
                            len = element.Text.Length - begin;
                        }

                        string strOffset   = element.Text.Substring(0, begin);
                        string strSelected = element.Text.Substring(begin, len);

                        Point offset    = Gui.Renderer.GetTextSize(strOffset, font);
                        Point selection = Gui.Renderer.GetTextSize(strSelected, font);
                        Gui.Renderer.DrawBox(p2.x + offset.x, p2.y, selection.x, selection.y, ColorInt.FromArgb(opacity, SelectionColor));
                        //}
                    }

                    if (!string.IsNullOrEmpty(element.Text))
                    {
                        perline += element.Text.Length;
                    }
                    else
                    {
                        perline++;
                    }
                }

                numLine++;
            }
        }
示例#9
0
文件: Gui.cs 项目: hershesz/Squid
        /// <summary>
        /// generates a standard skin
        /// this is only used for sample purposes
        /// </summary>
        /// <returns></returns>
        public static Skin GenerateStandardSkin()
        {
            ControlStyle baseStyle = new ControlStyle();

            baseStyle.Tiling                  = TextureMode.Grid;
            baseStyle.Grid                    = new Margin(3);
            baseStyle.Texture                 = "button_hot.dds";
            baseStyle.Default.Texture         = "button_default.dds";
            baseStyle.Pressed.Texture         = "button_down.dds";
            baseStyle.SelectedPressed.Texture = "button_down.dds";
            baseStyle.Focused.Texture         = "button_down.dds";
            baseStyle.SelectedFocused.Texture = "button_down.dds";
            baseStyle.Selected.Texture        = "button_down.dds";
            baseStyle.SelectedHot.Texture     = "button_down.dds";

            ControlStyle itemStyle = new ControlStyle(baseStyle);

            itemStyle.TextPadding = new Margin(10, 0, 0, 0);
            itemStyle.TextAlign   = Alignment.MiddleLeft;

            ControlStyle buttonStyle = new ControlStyle(baseStyle);

            buttonStyle.TextPadding = new Margin(0);
            buttonStyle.TextAlign   = Alignment.MiddleCenter;

            ControlStyle tooltipStyle = new ControlStyle(buttonStyle);

            tooltipStyle.TextPadding = new Margin(8);
            tooltipStyle.TextAlign   = Alignment.TopLeft;

            ControlStyle inputStyle = new ControlStyle();

            inputStyle.Texture         = "input_default.dds";
            inputStyle.Hot.Texture     = "input_focused.dds";
            inputStyle.Focused.Texture = "input_focused.dds";
            inputStyle.TextPadding     = new Margin(8);
            inputStyle.Tiling          = TextureMode.Grid;
            inputStyle.Focused.Tint    = ColorInt.ARGB(1, 0, 0, 1);
            inputStyle.Grid            = new Margin(3);

            ControlStyle windowStyle = new ControlStyle();

            windowStyle.Tiling  = TextureMode.Grid;
            windowStyle.Grid    = new Margin(9);
            windowStyle.Texture = "window.dds";

            ControlStyle frameStyle = new ControlStyle();

            frameStyle.Tiling      = TextureMode.Grid;
            frameStyle.Grid        = new Margin(4);
            frameStyle.Texture     = "frame.dds";
            frameStyle.TextPadding = new Margin(8);

            ControlStyle vscrollTrackStyle = new ControlStyle();

            vscrollTrackStyle.Tiling  = TextureMode.Grid;
            vscrollTrackStyle.Grid    = new Margin(3);
            vscrollTrackStyle.Texture = "vscroll_track.dds";

            ControlStyle vscrollButtonStyle = new ControlStyle();

            vscrollButtonStyle.Tiling          = TextureMode.Grid;
            vscrollButtonStyle.Grid            = new Margin(3);
            vscrollButtonStyle.Texture         = "vscroll_button.dds";
            vscrollButtonStyle.Hot.Texture     = "vscroll_button_hot.dds";
            vscrollButtonStyle.Pressed.Texture = "vscroll_button_down.dds";

            ControlStyle vscrollUp = new ControlStyle();

            vscrollUp.Default.Texture = "vscrollUp_default.dds";
            vscrollUp.Hot.Texture     = "vscrollUp_hot.dds";
            vscrollUp.Pressed.Texture = "vscrollUp_down.dds";
            vscrollUp.Focused.Texture = "vscrollUp_hot.dds";

            ControlStyle hscrollTrackStyle = new ControlStyle();

            hscrollTrackStyle.Tiling  = TextureMode.Grid;
            hscrollTrackStyle.Grid    = new Margin(3);
            hscrollTrackStyle.Texture = "hscroll_track.dds";

            ControlStyle hscrollButtonStyle = new ControlStyle();

            hscrollButtonStyle.Tiling          = TextureMode.Grid;
            hscrollButtonStyle.Grid            = new Margin(3);
            hscrollButtonStyle.Texture         = "hscroll_button.dds";
            hscrollButtonStyle.Hot.Texture     = "hscroll_button_hot.dds";
            hscrollButtonStyle.Pressed.Texture = "hscroll_button_down.dds";

            ControlStyle hscrollUp = new ControlStyle();

            hscrollUp.Default.Texture = "hscrollUp_default.dds";
            hscrollUp.Hot.Texture     = "hscrollUp_hot.dds";
            hscrollUp.Pressed.Texture = "hscrollUp_down.dds";
            hscrollUp.Focused.Texture = "hscrollUp_hot.dds";

            ControlStyle checkButtonStyle = new ControlStyle();

            checkButtonStyle.Default.Texture        = "checkbox_default.dds";
            checkButtonStyle.Hot.Texture            = "checkbox_hot.dds";
            checkButtonStyle.Pressed.Texture        = "checkbox_down.dds";
            checkButtonStyle.Checked.Texture        = "checkbox_checked.dds";
            checkButtonStyle.CheckedFocused.Texture = "checkbox_checked_hot.dds";
            checkButtonStyle.CheckedHot.Texture     = "checkbox_checked_hot.dds";
            checkButtonStyle.CheckedPressed.Texture = "checkbox_down.dds";

            ControlStyle comboLabelStyle = new ControlStyle();

            comboLabelStyle.TextPadding     = new Margin(10, 0, 0, 0);
            comboLabelStyle.Default.Texture = "combo_default.dds";
            comboLabelStyle.Hot.Texture     = "combo_hot.dds";
            comboLabelStyle.Pressed.Texture = "combo_down.dds";
            comboLabelStyle.Focused.Texture = "combo_hot.dds";
            comboLabelStyle.Tiling          = TextureMode.Grid;
            comboLabelStyle.Grid            = new Margin(3, 0, 0, 0);

            ControlStyle comboButtonStyle = new ControlStyle();

            comboButtonStyle.Default.Texture = "combo_button_default.dds";
            comboButtonStyle.Hot.Texture     = "combo_button_hot.dds";
            comboButtonStyle.Pressed.Texture = "combo_button_down.dds";
            comboButtonStyle.Focused.Texture = "combo_button_hot.dds";

            ControlStyle labelStyle = new ControlStyle();

            labelStyle.TextAlign   = Alignment.TopLeft;
            labelStyle.TextPadding = new Margin(8);

            Skin skin = new Skin();

            skin.Add("item", itemStyle);
            skin.Add("textbox", inputStyle);
            skin.Add("button", buttonStyle);
            skin.Add("window", windowStyle);
            skin.Add("frame", frameStyle);
            skin.Add("checkBox", checkButtonStyle);
            skin.Add("comboLabel", comboLabelStyle);
            skin.Add("comboButton", comboButtonStyle);
            skin.Add("vscrollTrack", vscrollTrackStyle);
            skin.Add("vscrollButton", vscrollButtonStyle);
            skin.Add("vscrollUp", vscrollUp);
            skin.Add("hscrollTrack", hscrollTrackStyle);
            skin.Add("hscrollButton", hscrollButtonStyle);
            skin.Add("hscrollUp", hscrollUp);
            skin.Add("multiline", labelStyle);
            skin.Add("tooltip", tooltipStyle);

            return(skin);
        }