Is there a better way to stop Menu from swallowing touches in 3.0?

I’ve added a menu to a scroll view (from extensions). The menu consumes/swallows the touches so the scroll view won’t scroll. I’m able to let the touches pass through only by modifying the Menu class initWithArray method.

There should be an easier way to do this, or maybe there is some reason it shouldn’t be done?

@Javy

please use ui::Button instead of menu.

Adding ui::Button to a scroll view also swallows touches, preventing the scroll view from being moved.

I’m not an expert at Cocos2d-x, so is there another way to add buttons to a scroll view, and have the buttons only respond to a touch event that hasn’t moved?

For now I’m sticking with modified Menu class because I have it working smoothly.

I found what happened. There are 2 scroll views. One in extensions and one under ui::ScrollView.

Using ui::Button with ui::ScrollView allows touches to operate properly.

@Javy

you could take a look at the cpp-tests project which has a Node-UI tests, there are sample usage of adding ui::Button to ui:ScrollView.
And also please use cocos2d-x version 3.1 or later.

The examples I found use json to load most of the content? Is there a more basic example that builds the components all in code without any configuration files? Maybe I am looking at the wrong example under Node::ui.

This seems to be an example but it is slightly out of date.