用cocostudio UI 中使用了Slider控件后,一直无法触发滑动事件
setTouchEnabled 设置为了true;
bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent)
{
bool pass = Widget::onTouchBegan(touch, unusedEvent);
if (_hitted)
{
Point nsp = convertToNodeSpace(_touchStartPos);
setPercent(getPercentWithBallPos(nsp.x));
percentChangedEvent();
}
return pass;
}
这里的pass 一直显示的为false