UIPageView Cocos2dx (c++) click trouble
Cocos2d-JS v3-
koko82Likes 1Problem 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 adminLikes 0
Check out this link for UIPageView’s
http://cocos.sonarlearning.co.uk/v1.0/docs/ui-elements-such-as-uibutton
This reply has been verified.
-
koko82Likes 0
The link does not contain the listener for the tap to move scene only identify when the page is being moved.
-
Sonar Systems adminLikes 0
Do you want to detect when the entire page is clicked?
-
koko82Likes 0
Yes but it leaves open for page turning..
-
Sonar Systems adminLikes 0
???????????
-
koko82Likes 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 adminLikes 0
Have you added an actual button onto the page?
-
koko82Likes 0
Yes looped 5 buttons onto each page.
-
Sonar Systems adminLikes 0
Could you show us the entire code for it please.
This reply has been verified.
-
koko82Likes 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 adminLikes 0
GREAT :D
This reply has been verified.
Login to reply