public SliderOption(string label, Func <int> getter, Action <int> setter, int minValue, int maxValue) : base(label) { _getter = getter; _setter = setter; _slider = new WidgetSlider(399, 9); _slider.SetMin(minValue); _slider.SetMax(maxValue); _slider.X = 178; _slider.Y = 2; Globals.UiManager.RemoveWindow(_slider); // Otherwise it'll show up as a top-level widget // Display the slider's min value to the left of the slider _minLabel = new WidgetText(_slider.GetMin().ToString(), "options-label-muted"); _minLabel.X = _slider.X - _minLabel.GetPreferredSize().Width - 5; _minLabel.SetCenterVertically(true); // Display the slider's max value to the left of the slider _maxLabel = new WidgetText(_slider.GetMax().ToString(), "options-label-muted"); _maxLabel.X = _slider.X + _slider.Width + 5; _maxLabel.SetCenterVertically(true); // Display the current value to the far right _valueLabel = new WidgetText(_slider.GetValue().ToString(), "options-label"); _valueLabel.X = _slider.X + _slider.Width + 40; _valueLabel.SetCenterVertically(true); _slider.SetValueChangeHandler(ValueChanged); }