Hello,
I have made a label component which shows slider value. Slider value starts from 0 to 10000. I want it to be displayed in multiple of a number like if I say it should be 100 the value when user drags should be 0, 100, 200β¦10000.
Is there a way to do this?
Best to use a basic slider and then make a test value that is multiplied by 100 before placed in the text.
find the slide number β send number to a temporary value β multiply it by 100 β send temporary value to the label node.
1 Like
This is how I want the slider to be.
Link to this example
When I provide a minimum and maximum value letβs say 38 to 192 it should start to move in steps like if steps is 5 then starts from 38 (min) next is 40, 45β¦190, 192.
You can try to register a callback for slider event, and adjust slider value to closest regulated value.
Pay attention the value range of progression is 0 to 1. Imagine you want to regulate all values to a step of five and in the range of 38-100. The callback logic should look like the following
if (slider.progress < 0.38) slider.progress = 0.38;
else {
slider.progress -= (slider.progress * 100) % 5 / 100;
}