class
SAPO.Component.SpriteToggle
Version:
0.1
Since:
Defined in
Component/SpriteToggle/0.1/lib.js
June 2011
Constructor Summary
Function Summary
Number
getValue()
returns the current value of the component
setValue
(Number
val)
sets the value of the component (if value part of valid interval)
Constructor Details
constructor SpriteToggle
SpriteToggle(String|DOMElement
element, Object
options)
Parameters:
element
- element which will be enriched (or its id)
options
- optional object to pass on options -
String sprite
- image sprite -
Number[] dimensions
- array of [w,h] (viewing window) -
Number[][] offsets
- array on [x,y] pairs, one for each valid option -
[ Number value ]
- initial value (number between 0 and number of options - 1) -
[ Function(val, comp) onChange ]
- callback function
Function Details
function getValue
Number
getValue()
returns the current value of the component
function setValue
setValue(Number
val)
sets the value of the component (if value part of valid interval)
Parameters:
val