Hi,
I have a crazy problem!
I’m using cc.ControlSlider, I was able to make it work on web,
but on Native, I have to click beneath the slider !
yes, I have to click few pixels under the slider to make it work.
if I touch the slider ,nothing will happen.
here is my code,
you can create new project and replace this code to app.js
and use your images
var HelloWorldLayer = cc.Layer.extend({
sprite:null,
ctor:function () {
this._super();
this.setAnchorPoint(0,0);
var size = cc.winSize;
var lvlSlider = new cc.ControlSlider(res.BgFile_png,
res.ProgressFile_png,
res.ThumbFile_png);
lvlSlider.minValue = 0;
lvlSlider.maxValue = 30;
lvlSlider.value = 10;
lvlSlider.setPosition(200,200);
lvlSlider.addTargetWithActionForControlEvents(this, this.valueChangedCallback, cc.CONTROL_EVENT_VALUECHANGED);
lvlSlider.setAnchorPoint(0,0);
this.addChild(lvlSlider);
return true;
}
,valueChangedCallback:function(sender,event){
cc.log("sender",sender.getValue());
}
});
var HelloWorldScene = cc.Scene.extend({
onEnter:function () {
this._super();
var layer = new HelloWorldLayer();
this.addChild(layer);
}
});
I’m using cocos2d-js 6.3.1
with idea Cocos IDE