コード例 #1
0
ファイル: UIInputManager.cpp プロジェクト: Michael-Z/SouShen
 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;
 }
コード例 #2
0
ファイル: UIInputManager.cpp プロジェクト: Michael-Z/SouShen
 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;
 }
コード例 #3
0
ファイル: UIInputManager.cpp プロジェクト: Michael-Z/SouShen
 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;
 }
コード例 #4
0
ファイル: UIInputManager.cpp プロジェクト: Michael-Z/SouShen
 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;
 }
コード例 #5
0
ファイル: UIInputManager.cpp プロジェクト: Michael-Z/SouShen
    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;
    }
コード例 #6
0
ファイル: UIInputManager.cpp プロジェクト: Michael-Z/SouShen
    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;
    }