Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button element to the GUI interface #5

Open
jshaw opened this issue Mar 12, 2017 · 3 comments
Open

Add button element to the GUI interface #5

jshaw opened this issue Mar 12, 2017 · 3 comments

Comments

@jshaw
Copy link

jshaw commented Mar 12, 2017

It would be quite useful to have a button element that can be included in the GUI panel interface. There's a couple use cases where a button in the GUI would make more sense than a checkbox. The dat.gui basic example has a good example of the feature labeled "explode".

@bifocalpirate
Copy link

It may be faster if you just use QuickSettings directly. I was debugging my app then realised p5.gui is a wrapper trying to expose the functionality of QuickSettings and DAT.GUI. If you just need a gui that will work with p5, then QuickSettings will do the job. Also, QuickSettings is on a CDN already.

@craftoid
Copy link
Member

@jshaw totally agree. That would be a nice feature. I will look in to this!

The type of the variable passed to p5.gui determines the type of the GUI element to be displayed.
It would make perfect sense to turn a function name / a variable name referencing a function into a button, that triggers the respective function when pressed.

@skrillex581 Correct. p5.gui, does not aim to become yet another GUI interface, it's a thin layer on top of existing GUIs (currently only QuickSettings) to magically create a GUI for your variables.

BTW: If you need CDN links you can use the ones provided by github:
https://cdn.rawgit.com/bit101/quicksettings/master/quicksettings.js
https://cdn.rawgit.com/bitcraftlab/p5.gui/master/libraries/p5.gui.js

@kabrio
Copy link

kabrio commented Jul 31, 2017

If you want buttons without having to deal with quicksettings, I just added (wrapped) the addButton function from quicksettings to p5.gui:
https://github.com/kabrio/p5.gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants