Exemplo n.º 1
0
 bool UIInputManager::onTouchCanceled(float x,float y)
 {
     this->m_bTouchDown = false;
     CocoWidget* hitWidget = this->m_pCurSelectedWidget;
     if (!hitWidget || !hitWidget->getActive()){
         return false;
     }
     this->touchEndedPoint.x = x;
     this->touchEndedPoint.y = y;
     hitWidget->onTouchReleased(this->touchEndedPoint);
     this->m_pCurSelectedWidget = NULL;
     hitWidget = NULL;
     return true;
 }
Exemplo n.º 2
0
 bool UIInputManager::onTouchPressed(float x,float y)
 {
     this->touchBeganedPoint.x = x;
     this->touchBeganedPoint.y = y;
     CocoWidget* hitWidget = this->checkEventWidget(this->touchBeganedPoint);
     if (!hitWidget || !hitWidget->getActive()){
         this->m_pCurSelectedWidget = NULL;
         return false;
     }
     this->m_pCurSelectedWidget = hitWidget;
     hitWidget->onTouchPressed(this->touchBeganedPoint);
     this->m_bTouchDown = true;
     return true;
 }
Exemplo n.º 3
0
 bool UIInputManager::onTouchCanceled(cocos2d::CCTouch* touch)
 {
     this->m_bTouchDown = false;
     CocoWidget* hitWidget = this->m_pCurSelectedWidget;
     if (!hitWidget || !hitWidget->getActive()){
         return false;
     }
     this->touchEndedPoint.x = touch->getLocation().x;
     this->touchEndedPoint.y = touch->getLocation().y;
     hitWidget->onTouchReleased(this->touchEndedPoint);
     this->m_pCurSelectedWidget = NULL;
     hitWidget = NULL;
     return true;
 }
Exemplo n.º 4
0
 bool UIInputManager::onTouchPressed(cocos2d::CCTouch* touch)
 {
     this->touchBeganedPoint.x = touch->getLocation().x;
     this->touchBeganedPoint.y = touch->getLocation().y;
     CocoWidget* hitWidget = this->checkEventWidget(this->touchBeganedPoint);
     if (!hitWidget || !hitWidget->getActive()){
         this->m_pCurSelectedWidget = NULL;
         return false;
     }
     this->m_pCurSelectedWidget = hitWidget;
     hitWidget->onTouchPressed(this->touchBeganedPoint);
     this->m_bTouchDown = true;
     return true;
 }
Exemplo n.º 5
0
    bool UIInputManager::onTouchMoved(float x,float y)
    {
        CocoWidget* hitWidget = this->m_pCurSelectedWidget;
        if (!hitWidget || !hitWidget->getActive()){
            return false;
        }
        this->touchMovedPoint.x = x;
        this->touchMovedPoint.y = y;
        hitWidget->onTouchMoved(this->touchMovedPoint);
		if (this->m_bTouchDown){
			this->m_fLongClickRecordTime = 0;
			this->m_bTouchDown = false;
		}
        return true;
    }
Exemplo n.º 6
0
    bool UIInputManager::onTouchMoved(cocos2d::CCTouch* touch)
    {
        CocoWidget* hitWidget = this->m_pCurSelectedWidget;
        if (!hitWidget || !hitWidget->getActive()){
            return false;
        }
        this->touchMovedPoint.x = touch->getLocation().x;
        this->touchMovedPoint.y = touch->getLocation().y;
        hitWidget->onTouchMoved(this->touchMovedPoint);
		if (this->m_bTouchDown){
			this->m_fLongClickRecordTime = 0;
			this->m_bTouchDown = false;
		}
        return true;
    }