Reputation: 119
The following is my code:
Button* buttonLogin = dynamic_cast<Button*>(m_pLayout->getChildByName("login_Button"));
if (buttonLogin)
buttonLogin->addTouchEventListener(this,toucheventselector(GameLoginLayer::touchButton));
when I debug the app, touchButton function is called twice. It's Weird. There's only one function in own codes will call the button function.
I check the cocostudio original file of UI, only on button was drawn.
Anyone has some suggestion?
Thanks.
Upvotes: 1
Views: 1523
Reputation: 119
The click event will be four types, details are in {TouchEventType}. One-time click, the mouse click handle function should switch the different types of events. So the issue of my code's that is not handled the TOUCH_EVENT_ENDED event.
It's actually a stupid question......
Upvotes: 1