The Slider object is a generic scrollbar control. It produces a numeric value whenever the user moves its thumb, which can be linked to a ScrollCanvas, a game variable or a script.
A slider is composed from two parts: the bar and the thumb (see fig 2). Both of these can be customized with NoveltyML.
Fig 1: A Slider object
Fig 2: Sliders are made up of a bar and a thumb
Example use cases:
- Scrollbars (see ScrollCanvas)
- User interface controls.
Visual components (such as Borders, Images) of a Slider will be automatically sized to fill the slider's rectangle unless a specific size is set.
The value of a slider can be linked to a script function, which gets called whenever the thumb is moved. Any function that returns void and takes one int, float or a double will work.
<!-- Slider with a border as the bar and an image as the thumb --> <Slider name="My slider" > <Bar> <Border texture="My border texture" color="grey" /> </Bar> <Thumb> <Image texture="My texture" /> </Thumb> </Slider>