Exemplo n.º 1
0
 public Slider(PercentChanged onChanged, float current = 1, float min = 0, float max = 1)
 {
     _onChanged = onChanged;
     _valueToCurrent = new Interpolation(min, max, 0, 1);;
     _currentToValue = new Interpolation(0, 1, min, max);
     Current = _valueToCurrent.From(current);
     Size = new Size(150, 15f);
 }
Exemplo n.º 2
0
        public MouseZoomController(float minZoom = 0.01f, float maxZoom = 2, UpdateTime updateTime = UpdateTime.Sim)
        {
            _updateTime = updateTime;
            _minZoom = minZoom;
            _maxZoom = maxZoom;

            _wheelIndexToZoomValue = new Interpolation(_minWheel, _maxWheel, _minZoom, _maxZoom, Ease);
            CurrentZoom = _wheelIndexToZoomValue.From(_currentWheelIndex);
            Add(new MouseWheelBinding(ChangeWheelIndex));
        }