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).
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.
|
VFader(x1, y1, x2, y2, minValue, maxValue, startValue, updateFunction, foreground, background, outline, thickness) | Creates a vertical fader. Everything else is same as above. |
You can create a fader as follows:
# function to specify what happens when fader is moved def printValue(value): print value # replace this with whatever needs to happen fader = VFader(25, 5, 45, 80, 0, 100, 50, printValue) display1.add(fader)
Once a fader has been created, the following functions are available:
Function | Description |
fader.getValue() | Returns the current value of the fader. |
fader.setValue(value) | Sets the current value of the fader to value. |