コード例 #1
0
        public SliderBox(HudParentBase parent) : base(parent)
        {
            background = new TexturedBox(this)
            {
                DimAlignment = DimAlignments.Both
            };

            border = new BorderBox(background)
            {
                Thickness    = 1f,
                DimAlignment = DimAlignments.Both,
            };

            slide = new SliderBar(this)
            {
                DimAlignment = DimAlignments.Both,
                SliderSize   = new Vector2(14f, 28f),
                BarHeight    = 5f
            };

            BackgroundColor      = TerminalFormatting.OuterSpace;
            BorderColor          = TerminalFormatting.LimedSpruce;
            BackgroundHighlight  = TerminalFormatting.Atomic;
            BackgroundFocusColor = TerminalFormatting.Mint;

            SliderColor      = TerminalFormatting.MistBlue;
            SliderHighlight  = Color.White;
            SliderFocusColor = TerminalFormatting.Cinder;

            BarColor      = TerminalFormatting.MidGrey;
            BarHighlight  = Color.White;
            BarFocusColor = TerminalFormatting.BlackPerl;

            UseFocusFormatting = true;
            HighlightEnabled   = true;

            Padding = new Vector2(18f, 18f);
            Size    = new Vector2(317f, 47f);

            slide.MouseInput.CursorEntered    += CursorEnter;
            slide.MouseInput.CursorExited     += CursorExit;
            slide.MouseInput.GainedInputFocus += GainFocus;
            slide.MouseInput.LostInputFocus   += LoseFocus;
        }
コード例 #2
0
        public ScrollBar(HudParentBase parent) : base(parent)
        {
            slide = new SliderBar(this)
            {
                Reverse     = true,
                Vertical    = true,
                SliderWidth = 13f,
                BarWidth    = 13f,

                SliderColor     = new Color(78, 87, 101),
                SliderHighlight = new Color(136, 140, 148),

                BarColor = new Color(41, 51, 61),
            };

            Size                = new Vector2(13f, 300f);
            Padding             = new Vector2(30f, 10f);
            slide.SliderVisible = false;
        }