SliderUI

This implements a basic slider component for specifying numbers between distinct bounds.

Parameters

  • min: number | ()=>number – this is the minimum of the range of numbers. It can either be a number or a function that returns a number. The function option lets the bounds change dynamically.
  • max: number | () =>number – this is the maximum of the range of numbers. It can either be a number or a function that returns a number. The function option lets the bounds change dynamically.

Attributes

  • .getF( getFF: ()=>number )getFF is a function that will be called to retrieve the current value of the slider.
  • setF( setFF: (newVal:number)=>void)setFF is a function that will be called whenever the slider is moved by the user. This receives the newVal for the slider and allows the code to do something with it.

Examples

new SliderUI(0,()=>{ return maximumValue; } )
     .getF(()=>{ return pig.weight; } )
     .setF((newWeight:number) => { pig.weight=newWeight; } );

Styling

  • SliderUI – default styling class