UIPageView Cocos2dx (c++) click trouble

Cocos2d-JS v3
  • koko82
    Likes 1

    Problem Description

    Hi

    Just wandering how to get UI::Pageview working it seems like its a little buggy, I am not able to differentiation between click and page turn. Once click (tap) I want to execute the next  scene however it just logs turning even if its just a tap. Any ideas? Or will I have to use something else as page view seems to have its own listener. 

    
    void ChapterSelection::GotoMainMenuScene (  cocos2d::Ref * pSender, cocos2d::ui::PageView::EventType type )
    {
      
        if (type == cocos2d::ui::PageView::EventType::TURNING){
              log("Turning");
            return;
        }
        else if ( type != cocos2d::ui::PageView::EventType::TURNING )
        {
             log("Not Turning");
        auto scene = MainMenu::createScene();
        
        Director::getInstance( )->replaceScene ( TransitionFade::create(TRANSITION_TIME, scene));
            
        }
    }

     


  • Sonar Systems admin
    Likes 0


    This reply has been verified.
  • koko82
    Likes 0

    The link does not contain the listener for the tap to move scene only identify when the page is being moved.

  • Sonar Systems admin
    Likes 0

    Do you want to detect when the entire page is clicked?

  • koko82
    Likes 0

    Yes but it leaves open for page turning..

  • Sonar Systems admin
    Likes 0

    ???????????

  • koko82
    Likes 0

    Sorry should have made myself clearer. The page needs to be able to swip and the button needs to be able to be clicked. At the moment its only allowing swipe and doesnt allow tap to enter a new scene. It needs to differenciate between the swipe to a new page and a button click. Also another scenario is that it doesnt detect a swipe as a click.

  • Sonar Systems admin
    Likes 0

    Have you added an actual button onto the page?

  • koko82
    Likes 0

    Yes looped 5 buttons onto each page.

  • Sonar Systems admin
    Likes 0

    Could you show us the entire code for it please.


    This reply has been verified.
  • koko82
    Likes 1

    I’ve used scrollview instead seems to work better than trying to do two listeners with an integrated listener for the page slide, thanks for the help.


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    GREAT :D


    This reply has been verified.

Login to reply