Fader

Fader objects are created using the following functions.  Faders are drawn between a starting point (x1, y1) and an ending point (x2, y2).

There are two types of faders, a horizontal fader (HFader) and a vertical fader (VFader).

Function Description
HFader(x1, y1, x2, y2) Creates a horizontal fader from point x1, y1, to point x2, y2.
VFader(x1, y1, x2, y2) Creates a vertical fader from point x1, y1, to point x2, y2.

More details (controlling fader functionality) may be provided as follows:

HFader(x1, y1, x2, y2, minValue, maxValue, startValue, updateFunction, foreground, background, outline, thickness) Creates a horizontal fader from point x1, y1, to point x2, y2. minValue is the value reported when fader is at min (default is 0). maxValue is value reported when fader at max (default is 999). startValue initial fader setting (default is middle). updateFunction is function to call when fader is moved. Fader colors can be set with foreground (default is Color.RED), background (default is Color.BLACK), and outline (default is Color.BLACK). thickness is the fader outline thickness (default is 3).
VFader(x1, y1, x2, y2, minValue, maxValue, startValue, updateFunction, foreground, background, outline, thickness) Creates a vertical fader from point x1, y1, to point x2, y2. minValue is the value reported when fader is at min (default is 0). maxValue is value reported when fader at max (default is 999). startValue initial fader setting (default is middle). updateFunction is function to call when fader is moved. Fader colors can be set with foreground (default is Color.RED), background (default is Color.BLACK), and outline (default is Color.BLACK). thickness is the fader outline thickness (default is 3).

Once a fader has been created, it may be added to a Display specifying where to place its leftmost point.

def printValue(value):
   print value

v = VFader(25, 5, 45, 80, 0, 100, 50, printValue)
display1.add(v)