dataarts / dat.guiVR

A flexible graphical user interface for changing variables within WebVR.
https://workshop.chromeexperiments.com/examples/guiVR/
Apache License 2.0
312 stars 49 forks source link

Add "button" control #5

Closed customlogic closed 8 years ago

customlogic commented 8 years ago

Add a control that takes a function as an input, and creates a button on the GUI. When the user presses the button, the function executes.

Perhaps the UI element is similar to the checkbox, but after you press it, it returns to it's start state.

mflux commented 8 years ago

You can now add controllers to functions like

        gui.add( state, 'reset' )

Where reset is a function on "state".

I've actually always wanted a

gui.add( someFunction ) 

and have that work instead of the ugly workaround

gui.add( {someFunction:function(){}}, 'someFunction' ); 

Maybe that can be a new issue.