Reputation: 11619
There seem to be no onStartChange
event in dat.gui, is there a simple workaround?
Upvotes: 5
Views: 3977
Reputation: 20230
You can use the onChange event. This is fired at the start of a change.
Upvotes: 3
Reputation: 61
If you are moving a scroller the onChange will update as the change is occurring. If you want it to only update after all changes then use .onFinishChange, here is an example below using onChange.
gui.add(options, "distance").min(1).max(300).step(1)
.onChange(
function(){
yourVar = this.getValue();
}
)
The api docs are now located here onChange
Upvotes: 0