Ejemplo n.º 1
0
void UISlider::onTouchMoved(const CCPoint &touchPoint)
{
    CCPoint nsp = m_pRenderer->convertToNodeSpace(touchPoint);
    m_pSlidBallRenderer->setPosition(ccp(nsp.x,0));
    setPercent(getPercentWithBallPos(nsp.x));
    percentChangedEvent();
}
Ejemplo n.º 2
0
void Slider::onTouchMoved(Touch *touch, Event *unusedEvent)
{
    _touchMovePosition = touch->getLocation();
    Vec2 nsp = convertToNodeSpace(_touchMovePosition);
    setPercent(getPercentWithBallPos(nsp.x));
    percentChangedEvent();
}
Ejemplo n.º 3
0
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();
}
Ejemplo n.º 4
0
bool UISlider::onTouchBegan(const CCPoint &touchPoint)
{
    bool pass = UIWidget::onTouchBegan(touchPoint);
    CCPoint nsp = m_pRenderer->convertToNodeSpace(touchPoint);
    setPercent(getPercentWithBallPos(nsp.x));
    percentChangedEvent();
    return pass;
}
Ejemplo n.º 5
0
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();
}
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
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;
}
Ejemplo n.º 8
0
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();
    }
}
Ejemplo n.º 10
0
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();
    }
}
Ejemplo n.º 11
0
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;
}
Ejemplo n.º 12
0
void Slider::onTouchMoved(Touch *touch, Event *unusedEvent)
{
    _touchMovePosition = touch->getLocation();
    setPercent(getPercentWithBallPos(_touchMovePosition));
    percentChangedEvent(EventType::ON_PERCENTAGE_CHANGED);
}