BUFI - a lightweight script-based GUI for use with p5js

edited March 2016 in Share Your Work

This is a lightweight GUI library (partly inspired by this thread) that I'm currently working on. It's effectively a simplified equivalent to ControlP5 for use in p5js; or other JS based applications (it has no dependency on p5js).

You can use it to add controls directly from your sketch code (no need for manual HTML editing!) and register a callback function that feeds user input directly to your p5js sketch. Current supported controls are as follows:

  • buttons
  • checkboxes
  • switches - just fancy checkboxes ;)
  • radio buttons
  • range slider for numeric input
  • grouped controls

Styling is currently added care of Materialize; though I may offer a more lightweight alternative if I can't get the current CSS file size down somewhat...

This is still very much in beta; but I'm releasing it here to see if I can get some feedback from any would-be guinea pigs :D

Edit: I've updated the source links to the latest version and my newly created repo. You can now set the values of controls from within your sketch code. Going to update the demo shortly :)

Comments

  • Thanks for that! Nice to have that kind of control, and perhaps it'll make it a bit easier to convert sketches that currently rely on ControlP5...

  • Thanks! Just posted an updated demo and links to the latest source files with added functionality. I still have a minor bug to fix and I want to reduce CSS size substantially; but otherwise reasonably happy with how this turned out. It is perhaps a little configuration heavy; but hopefully the format is easy enough to understand.

    I may look into simplifying it further; though it's worth mentioning that @Andreas_Ref helpfully linked to an existing lightweight GUI library: dat.GUI. That looks somewhat more mature and feature-rich than mine!

Sign In or Register to comment.