Beispiel #1
0
 void AbstractScene::endTouch(int fingerIndex, const glm::vec2& position)
 {
     glm::vec2 p = position;
     bool result = false;
     FOR_EACH_COMPONENT(onBeforeTouchEvent(TouchEvent::End, fingerIndex, p, result));
     if (!result)
         onTouchEnded(fingerIndex, position);
     FOR_EACH_COMPONENT_REVERSE(onAfterTouchEvent(TouchEvent::End, fingerIndex, p, result));
 }
void UIPageView::onTouchMoved(const CCPoint &touchPoint)
{
    m_touchMovePos.x = touchPoint.x;
    m_touchMovePos.y = touchPoint.y;
    handleMoveLogic(touchPoint);
    if (m_pWidgetParent)
    {
        m_pWidgetParent->checkChildInfo(1,this,touchPoint);
    }
    moveEvent();
    if (!hitTest(touchPoint))
    {
        setFocused(false);
        onTouchEnded(touchPoint);
    }
}
void UIBuyBuildingLayer::onTouchCancelled( Touch * touch, cocos2d::Event *event )
{
	onTouchEnded(touch,event);
}
void ComsumeController::onTouchCancelled(Touch *touch, Event *unused_event)
{
    //タップ終了と同じ処理を行う
    onTouchEnded(touch, unused_event);
}
void LittleSnake::onTouchCancelled(Touch* touch, Event* event)
{
	onTouchEnded(touch, event);
}
void UINumberPicker::onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *unused_event)
{
    onTouchEnded(touch,unused_event);
}
Beispiel #7
0
void GameScreen::onTouchCancelled(cocos2d::Touch* touch, cocos2d::Event* event)
{
    onTouchEnded(touch, event);
}
Beispiel #8
0
void MainScene::onTouchCancelled(Touch *touch, Event *unused_event) {
	onTouchEnded(touch, unused_event);		// タップ終了処理を呼び出す
}
Beispiel #9
0
void Joystick::onTouchCancelled(Touch* touch, Event* event)
{
    onTouchEnded(touch, event);
}
//触摸:结束
void CNFServerChangeScrollLayer::onTouchEnded(Touch *pTouch, Event *pEvent)
{
    if(m_bTouching==false)return;

    m_bTouching = false;
    
    Vec2 ptTouchPoint =pTouch->getLocation();
    Vec2 ptMyPos = getPosition();

    
    //判断移到哪一页
    float fDisX = ptTouchPoint.x - m_fTouchBeginPosX;

    //判定滑动
    if ( _NF_ABS(fDisX)>= 20)
    {
        //向左滑动
        if (fDisX < 0)
        {
            //若未过界
            if (getPositionX() > m_fEndLayerPos)
            {
                int fLen = (int)getPositionX()%(int)m_fPageWidth;
                ptMyPos.x = (int)( getPositionX() - fLen - m_fPageWidth);
                Action *pMoveTo=MoveTo::create(0.3f,ptMyPos);
                runAction(pMoveTo);
            }
        }
        //向右滑
        if (fDisX > 0)
        {
            //若未过界
            if (getPositionX() < 0)
            {
                int fLen = (int)getPositionX()%(int)m_fPageWidth;
                ptMyPos.x = (int)( getPositionX() - fLen);
                Action *pMoveTo=MoveTo::create(0.3f,ptMyPos);
                runAction(pMoveTo);
            }
        }
    }

    //判断是否越界
    if (getPositionX()>0)
    {
        ptMyPos.x = 0;
        Action *pMoveTo=MoveTo::create(0.3f,ptMyPos);
        runAction(pMoveTo);
    }
    else if (getPositionX()<m_fEndLayerPos)
    {
        ptMyPos.x = m_fEndLayerPos<0?m_fEndLayerPos:0;
        Action *pMoveTo=MoveTo::create(0.3f,ptMyPos);
        runAction(pMoveTo);
    }

    //滑动层,当前坐标
    Vec2 LayerPos;
    LayerPos.x = getPositionX();
    LayerPos.y = getPositionY();

    //若触摸到按钮
    if (m_bIsTouchBtn==true)
    {
//        CCMenu *pMenu = dynamic_cast<CCMenu*>(getChildByTag(enTagMenu));
        auto pMenu = static_cast<Menu*>(getChildByTag(enTagMenu));
        if (pMenu!=NULL)
        {
            pMenu->onTouchEnded(pTouch,pEvent);
        }
        m_bIsTouchBtn = false;
    }
    
}
void MainMenu::onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event * event)
{
	onTouchEnded(touch, event);
}
Beispiel #12
0
void CControlView::onTouchCancelled(CCTouch *pTouch, float fDuration)
{
	onTouchEnded(pTouch, fDuration);
}
void ReserveRetunrHomeController::onTouchCancelled(Touch *touch, Event *unused_event)
{
    //タップ終了と同じ処理を行う
    onTouchEnded(touch, unused_event);
}
//-------------------------------------------------------------------------
void FKCW_UIWidget_ControlView::onTouchCancelled(CCTouch *pTouch, float fDuration)
{
	onTouchEnded(pTouch, fDuration);
}
void GameLayer::onTouchCancelled(Touch* touch, Event* unused_event)
{
    onTouchEnded(touch, unused_event);
}
bool HelloWorld::onTouchBegan(Touch *touch, Event *unused_event)
{
	onTouchEnded(touch, unused_event);
	return true;
}
void PathEditor::onTouchCanceled(Touch *touch, Event *event)
{
	onTouchEnded( touch, event );
}
void GatyaTenDrawScene::onTouchCancelled(Touch* touch, Event* unused_event)
{
    onTouchEnded(touch, unused_event);
}
void HelloWorld::onTouchCancelled(Touch *touch, Event *unused_event){
    //タップ終了と同じ処理を行う
    onTouchEnded(touch, unused_event);
}
Beispiel #20
0
void GameLayer::onTouchCancelled(Touch *touch, Event *event)
{
    onTouchEnded(touch, event);
}
Beispiel #21
0
void HomeScene::onTouchCancelled(cocos2d::Touch* touch,cocos2d::Event* unused_event){
    onTouchEnded(touch,unused_event);
}