-
Notifications
You must be signed in to change notification settings - Fork 21
Knob Element Interface
The Knob Element is a simple control knob with a single value that ranges from 0 to 1. A knob can be controlled by the user clicking on it and dragging it up and down. A series of ordered images (frames) is used to display the various knob states. The Knob interface is defined in Knob.js.
Knob.prototype.getready = function (args) // {Object}
Other than the Graphical Element Interface constructor parameters, Knob has some unique parameters:
-
sensitivity {Int}
: sensitivity parameter for the knob, or how much dragging affects change in the internal value of the knob. -
imagesArray {Array}
: An array of images, ordered from the frame associated with the lowest value (0) to the frame associated with the highest (1).
-
values.knobvalue {Int}
: The knobvalue of a knob reflects its internal state. It ranges from 0 to 1. -
defaultSlot {String = 'knobvalue'}
: The default slot of a knob is its only slot, called 'knobvalue'.
Knob.prototype._getImageNum = function ()
This method translates from the internal knob value to the index of the image (in the imagesArray
array) that should be used to draw the knob in its current state.
The return value is a Integer, ranging from 0
to imagesArray.length - 1
.
Knob.prototype._getImage = function ()
This method returns the image, from the imagesArray
array, that should be used to draw the knob in its current state.
The return value is an Image object.