我正在做一个钛移动项目,我想更新一些变量。
如何更新“exports.presets”中的一些变量?这对我来说看起来很容易,但不幸的是我不能这样做..
exports.presets = {
Filter1:new superimageview.Filter(function(){
this.brightness(slider1.value)
.saturation(slider2.value)
.contrast(slider3.value)
.channels({r:0.4,g:0.6,b:0.2});
}),
Filter2:new superimageview.Filter(function(){
this.brightness(slider1.value)
.saturation(slider2.value)
.contrast(slider3.value)
.channels({r:0.2,g:0.1,b:0.1});
}),
Filter3:new superimageview.Filter(function(){
this.brightness(slider1.value)
.saturation(slider2.value)
.contrast(slider3.value)
.channels({r:0.0,g:0.2,b:0.6});
})
};
//
var slider1 = Titanium.UI.createSlider({
top: 20,
min: -0.5,
max: 0.5,
width: '100%',
value: 0
});
slider1.addEventListener('change', function(e) {
label.text = e.value;
// XXX What to do here?
});