-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Ability to change min/max/step etc at Runtime #63
Comments
Currently there is no way to change parameters at runtime for maintainability reason. Please dispose a component and re-create it with new config. |
Hi, This might work but how do I dispose a component (say an input) and then recreate it in the same place? Thanks, Chris |
Ah I forgot to add |
Ah, I see that. So calling .dispose on the input binding will remove the item. My next difficult question is - can I then re-add a new input in the same place that I've just removed one? I've taken a look at the codebase - I see the problem with updating the config at runtime . Views are created in the view constructor with a div which is then appended. Unfortunately, I don't code ts so I'm struggling to work out how to allow the view to be recreated in the same place if the config is changed. Chris |
You can use |
Here is a simple example for re-creating a component with new config: https://codepen.io/cocopon/pen/pogJVQp |
AH, Missed that. Fabulous. FYI, I am asking about the config because I'm controlling a 3D scene where you can put sub objects on the face of an existing object. Obviously, if you choose a different face, then the boundary of where you can place the sub object will change. Hence my questions! Chris |
I understand! Thank you for the detailed information. |
Hi, Hidden works really well - thanks. Many thanks. Chris |
Hi,
I'm confused by this one. I don't know how to update any config of the config parameters at runtime.
For example:
Create a point 2D menu
config = {label:'Center',x: {min: -100, max: 100, step:0.1 },y: {min: -100, max: 100, step:0.1 }};
tweakpane.addInput(menu, 'value', config);
If I then change config sometime later (because the user has changed a container size for example)
config.x.min = -10
tweakpane.refresh();
The min/max values are not updated. Not sure how to even hack this one?
Chris
The text was updated successfully, but these errors were encountered: