Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing bounds of variable dynamically #45

Open
GoogleCodeExporter opened this issue Nov 4, 2015 · 1 comment
Open

changing bounds of variable dynamically #45

GoogleCodeExporter opened this issue Nov 4, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Not a issue, more like a feature reques.

Is it possible to update a max bound value when another variable changes?

Example:

var settings = { max: 10, totalPoints: 10 }

gui.add(settings, 'max', 0, 10);
gui.add(settings, 'totalPoints, 0, @settings.max)

So when I change the max value to 6, I wanted the same behaviour like:
gui.add(settings, 'totalPoints, 0, 6)

Original issue reported on code.google.com by [email protected] on 12 Dec 2013 at 12:37

@GoogleCodeExporter
Copy link
Author

Try this:

controllerMax = gui.add(settings, 'max', 0, 10);
controllerMax.onFinishChange(function () { 
controllerMax.__max = new_max_value;
 });

Original comment by [email protected] on 9 Jun 2015 at 5:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant