5

dat.gui中似乎没有onStartChange事件,有简单的解决方法吗?

4

2 回答 2

3

您可以使用onChange事件。这是在更改开始时触发的。

于 2014-10-25T19:39:17.683 回答
0

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

于 2020-09-03T19:20:02.170 回答