We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have been looking for a library like controlP5 to implement in my p5.js sketches, to enable users to change the values of parameters via sliders, knobs, radiobuttons, bangs etc...
Have not been able to find one...
What do people use instead? - Standard html elements (buttons, sliders, etc)? - Existing javascript libraries? - Something else?
Cheers
Answers
I would say, standard html elements. It may be even better, cause you can place them aside from canvas, so you have drawing and controls separated.
Okay, makes sense. Thanks!
Never used it, but I think Zebra is more intuitive for a Java developer: ~O)
http://www.ZebKit.com/
http://repo.ZebKit.org/latest/samples/uidemo.html
I did start rolling my own: it basically just dynamically injects standard form elements with an event listener that handles user updates. Not at all intended for distribution but at least demonstrates that it doesn't take much to build a simple implementation.
However it would probably be simplest to use an existing library: for example jQuery mobile has some nicely styled controls (e.g. range slider. checkbox etc.) and ought to be relatively lightweight. It looks like you have to manually set up the form; but you can of course do this dynamically which will make it more straightforward to then attach event listeners to the form objects and feed values back to your sketch.
@Andreas_Ref: this thread inspired me to start over with my own home grown GUI micro-library. I was looking for a project to try out with Browserify and this seemed ideal. I'm a lot happier with version 2 :D
@blindfish: That is so cool! I actually ended up using dat.GUI but I will definitely check your GUI micro-library out :)
Looks like I could have saved myself some effort :)) :(( :)) :((
In comparison mine definitely needs some polish; still it's been a good learning exercise: I'll have to check out dat - though reckon they should work on their SEO! I thought I'd done a thorough search for JS based GUI tools :/
https://forum.processing.org/two/discussion/15370/bufi-a-lightweight-script-based-gui-for-use-with-p5js#latest
looking into this as well and found Martin Schneider's p.5gui. https://github.com/bitcraftlab/p5.gui
I bet you saw it already ;)