koalago
koalago

Reputation: 119

cocos2dx 3.0 beta2 Button Click function is called twice by one time click

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

Answers (1)

koalago
koalago

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

Related Questions