- Home /
UI slider with dynamic arrangement
Hello, i've made research but i didn't find anything similar.
I want to create UI slider with different value arrangement.
Therefore, roughly said, i want to set 5% of value to be shown on first 20% slider, and other 95% of value to be shown on the remaining 95% of slider bar image, but with gradually transition if it's possible.
I think this is very hard question, but please help if you have some idea. :/ :)
Answer by UnityCoach · Apr 10, 2017 at 04:17 PM
So, if I sum it up, you want :
0 = 0
20 = 5
60 (((100-20)/2)+20) = 52.5 (((100-5)/2)+5)
100 = 100
The best way I know to manage arbitrary value mapping is using AnimationCurves.
So, you can have a UI Slider go from 0 to 1 in a linear way, but have a script give you a value modified with an AnimationCurve, using AnimationCurve.Evaluate (value)
.
Thank you so much, i havent worked with curves but 'i'll give my best!
Your answer
Follow this Question
Related Questions
Access text label inside a button - Unity 5.1.4 1 Answer
Android performance hit on changing Button.Interactable 1 Answer
Canvas is hiding my 3D model, can I place the model in front of the canvas? 1 Answer
How to make my code stop running, until the player responses to a prompt 1 Answer
UNet and player UI 1 Answer