Interface variables - sliders affecting sliders

China☆狼群 提交于 2020-02-06 04:31:21

问题


Let's say I have two sliders on my interface. Slider one goes from 0-500 and slider two goes from 0-100.

Is there anyway of setting it so that the value of slider one influences the possible values for slider two. So if I set slider one to 500, slider two can only be values from 0-30, for example.

Alternatively it would not necessarily have to be a slider affecting another slier, it could be a button. So if I have buttons A and B, if I select A the slider can be 0-10 but if I select B only 20-50.

Bit of a strange query I admit, I've just been tasked with making an interactive "model" for kids to try out different systems.

Thanks for taking the time to read this.


回答1:


Yes, you can do this. Example: make 3 sliders: test0, test1, test2. Let the min and max values of test0 be test1 and test2. Let the min and max values of test1 be 0 and 5, and set a value of 1. Let the min and max values of test2 be 95 and 100, and set a value of 99. Your test0 slider will now work as hoped.

BUT what happens if you make the min and max values of test0 to test2 and test1? OK, you get odd behavior, which is likely to look broken to your "kids". So ... this arrangement is not a good one. If you describe your goals in more details, maybe we can find a better solution.



来源:https://stackoverflow.com/questions/30345438/interface-variables-sliders-affecting-sliders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!