Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce touch down event support for CCMenu #13622

Closed
wants to merge 1 commit into from

Conversation

giginet
Copy link
Contributor

@giginet giginet commented Aug 29, 2015

We can't activate callback functions when MenuItems are pressed down.

This PR make it to enable to handle touch down event on Menu.

auto menuItem = cocos2d::MenuItemImage::create("button.png", "button.png", [](Ref *button) {
    cocos2d::log("touch down event");
});
auto menu = cocos2d::Menu::create(menuItem, nullptr);
menu->setEventType(cocos2d::Menu::EventType::TOUCH_DOWN);

@pandamicro
Copy link
Contributor

I think it's a good add-up to the current Menu system, but it adds new APIs, so I need your opinion @minggo @zilongshanren

@pandamicro pandamicro added this to the unconfirmed milestone Sep 1, 2015
@giginet
Copy link
Contributor Author

giginet commented Sep 10, 2015

Hi, any update on this issue?
do you think about this feature? Please check it.
@minggo @zilongshanren

Thank you 😃

{
_selectedItem->activate();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need these codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if event_type was TOUCH_UP, activate should not be called when touch is began.

@minggo
Copy link
Contributor

minggo commented May 23, 2016

There is already onTouchBegan, onTouchMove events, why need these events? And it seems they are duplicated.

@minggo minggo removed this from the unconfirmed milestone Aug 19, 2016
@minggo minggo removed the api:added label Feb 15, 2017
@minggo minggo closed this Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants