Esempio n. 1
0
        public Slider(string id, Func <int> getter, Action <int> setter, int min, int max) : base(Handlers)
        {
            _getter = getter;
            _setter = setter;
            _min    = min;
            _max    = max;

            _decrementKey = $"{id}.Slider.Decrement";
            _incrementKey = $"{id}.Slider.Increment";
            _id           = id;

            _decrement = new Button(_decrementKey, "<")
            {
                Typematic = true
            };
            _increment = new Button(_incrementKey, ">")
            {
                Typematic = true
            };

            var track = new SliderTrack(_id, getter, min, max);

            _frame = new ButtonFrame(track)
            {
                State   = ButtonState.Pressed,
                Padding = 0
            };

            Children.Add(_decrement);
            Children.Add(_frame);
            Children.Add(_increment);
        }
Esempio n. 2
0
 public SliderThumb(Func <int> getter) : base(Handlers)
 {
     _getter = getter;
     _text   = new Text("").Center();
     _frame  = new ButtonFrame(_text)
     {
         Theme = Theme
     };
     Children.Add(_frame);
 }
Esempio n. 3
0
        public StatusBarHealthBar(int order, bool isHealth) : base(Handlers)
        {
            _order    = order;
            _isHealth = isHealth;
            _bar      = new UiRectangle(isHealth ? CommonColor.Green5 : CommonColor.Teal3)
            {
                MeasureSize = new Vector2(20, 2)
            };

            _frame = new ButtonFrame(_bar)
            {
                Theme = isHealth ? HealthTheme : ManaTheme, Padding = 0
            };
            Children.Add(_frame);
        }