Processing ControlP5 library example 2 : Style and setValue

In this example you’ll see how to style the GUI that you’ve made with the ControlP5 library ( see first article : Processing ControlP5 library example 1 : user interface for the basics. )

controlP5 styling interface elements

View the sketch in action at
Download the zip-file ( with all the examples ) : This example is pretty straight forward. You give some style the controlP5 object with the ‘setControlFont’ and ‘setColor….’ methods. In the controlEvent function we use the values of some control elements to control the value of others. The setValue method is useful when you want to monitor variables in a visual way.
  • Slider1 controls Slider2.
  • Bang1 sets Toggle1 to 1 (on/true).
  • Button1 sets Toggle1 to 0 (off/false).
  • Numberbox1 controls Knob1.