Closed bolopenguin closed 10 months ago
Update
I fixed in this way:
let minValue = -10;
let maxValue = 10;
const stc = sliderInputs.controller.valueController;
const sc = stc.sliderC_.props.valMap_;
sc.min.value_ = minValue;
sc.max.value_ = maxValue;
But I keep using private methods...
Tweakpane v4 creates SliderInputBindingApi
for slider inputs, so you can access its min
and max
directly:
const pane = new Pane();
const i = pane.addBinding(params, 'foo', {
min: 0,
max: 1,
});
i.min = -100;
i.max = 100;
API: https://tweakpane.github.io/docs/api/classes/SliderInputBindingApi.html
That solved my issue. Thank you so much for the fast answer.
Fixed previous code:
let minValue = -10;
let maxValue = 10;
sliderInputs.min = minValue;
sliderInputs.max = maxValue;
Hello, I have some problems to dinamically update the sliders min and max values.
Working on
"tweakpane": "^4.0.1"
.I was updating the values as described in this previous issue.
In particular this is my simplified code:
The values are not being updated, and I get the following error:
There is a new updated way to do this? Perhaps without using private attributes? Thank you in advance for your support.