lil-gui
lil-gui copied to clipboard
Function controllers call onChange on click
Lovely library you have going here! Thought it'd be nice to have some sort of callback when a function button is clicked, similar to the onChange with other controllers.
Thanks!
So I agree, that would be convenient. At one point I thought about making it so that onChange
and onFinishChange
would be fired on click (given they don't do anything now). It felt a little wrong though: clicking a button isn't really a "change" and it would also trigger the parent GUI's onChange events, etc.
If the library does provide this, I think it would have to be a new method specific to FunctionController. Essentially shorthand for this:
controller.$button.addEventListener( 'click', myFunc );
Wondering aloud what that might be called...
Hey just an update that this is in 0.18 — see discussion here: https://github.com/georgealways/lil-gui/issues/64#issuecomment-1426786805