void UISlider::onTouchMoved(const CCPoint &touchPoint) { CCPoint nsp = m_pRenderer->convertToNodeSpace(touchPoint); m_pSlidBallRenderer->setPosition(ccp(nsp.x,0)); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); }
void Slider::onTouchMoved(Touch *touch, Event *unusedEvent) { _touchMovePosition = touch->getLocation(); Vec2 nsp = convertToNodeSpace(_touchMovePosition); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); }
void UISlider::onTouchMoved(const cocos2d::Point &touchPoint) { cocos2d::Point nsp = _renderer->convertToNodeSpace(touchPoint); _slidBallRenderer->setPosition(cocos2d::Point(nsp.x,0)); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); }
bool UISlider::onTouchBegan(const CCPoint &touchPoint) { bool pass = UIWidget::onTouchBegan(touchPoint); CCPoint nsp = m_pRenderer->convertToNodeSpace(touchPoint); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); return pass; }
void Slider::onTouchMoved(CCTouch *touch, CCEvent *unused_event) { _touchMovePos = touch->getLocation(); CCPoint nsp = convertToNodeSpace(_touchMovePos); _slidBallRenderer->setPosition(CCPoint(nsp.x,0)); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); }
bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent) { bool pass = Widget::onTouchBegan(touch, unusedEvent); if (_hitted) { setPercent(getPercentWithBallPos(_touchBeganPosition)); percentChangedEvent(EventType::ON_SLIDEBALL_DOWN); } return pass; }
bool Slider::onTouchBegan(CCTouch *touch, CCEvent *unused_event) { bool pass = Widget::onTouchBegan(touch, unused_event); if (_hitted) { CCPoint nsp = convertToNodeSpace(_touchStartPos); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); } return pass; }
bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent) { bool pass = Widget::onTouchBegan(touch, unusedEvent); if (_hitted) { Vec2 nsp = convertToNodeSpace(_touchBeganPosition); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); } return pass; }
void UISlider::onTouchMoved(const CCPoint &touchPoint) { CCPoint nsp = m_pRender->convertToNodeSpace(touchPoint); m_pSlidBall->setPosition(ccp(nsp.x,0)); checkSlidBoundary(); m_nBarPercent = getPercentWithBallPos(m_pSlidBall->getPosition().x,0); percentChangedEvent(); if (m_bProgressBarVisible) { setProgressBarScale(); } }
void UISlider::onTouchBegan(const CCPoint &touchPoint) { UIWidget::onTouchBegan(touchPoint); CCPoint nsp = m_pRender->convertToNodeSpace(touchPoint); m_pSlidBall->setPosition(ccp(nsp.x,0)); m_pSlidBall->setPressState(WidgetStateSelected); m_nBarPercent = getPercentWithBallPos(m_pSlidBall->getPosition().x,0); percentChangedEvent(); if (m_bProgressBarVisible) { setProgressBarScale(); } }
bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent) { bool pass = Widget::onTouchBegan(touch, unusedEvent); Vec2 nsp = convertToNodeSpace(_touchBeganPosition); Rect rect(0, 0, getContentSize().width, getContentSize().height); if (rect.containsPoint(nsp)) { if (!_hittedByCamera) { auto camera = Camera::getVisitingCamera(); if (Widget::hitTest(_touchBeganPosition, camera, nullptr)) _hittedByCamera = camera; } setPercent(getPercentWithBallPos(_touchBeganPosition)); percentChangedEvent(EventType::ON_SLIDEBALL_DOWN); } return pass; }
void Slider::onTouchMoved(Touch *touch, Event *unusedEvent) { _touchMovePosition = touch->getLocation(); setPercent(getPercentWithBallPos(_touchMovePosition)); percentChangedEvent(EventType::ON_PERCENTAGE_CHANGED); }