With the hope to have Gesture Recognizer in the next versions of Cocos2d-x I want to
share with you my works about this topic.
If the work is appreciated and there are serious intentions for an integration with Cocos2d-x, I will keep working on the code making it more robust and adding features.
In this phase I think it can be useful to test the classes together before a possible pull request in the official cocos2d-x project.
Here you can download the code with some test scenes:
A custom ScrollView that adds to ui::ScrollView the following features:
Pinch to zoom
Double tap to zoom in and out towards the tapped point
Note1:
The custom ScrollView is only a âproof of conceptâ, not a ârobust classâ to deploy in your projects!
Note2:
The custom ScrollView could not compile with older (than 3.11) versions of Cocos2d-x.
If this happens to you, comment the line in the file âTest/EnableScrollViewTest.hâ
I think there is work to be done to have a robust âGestureScrollViewâ class!
My purpose here was to show how the Gesture Recognizer can be used to add a lots of new features to Cocos2d-x!
Hi @drakon99 We should be releasing the package manager very soon. Why donât you and I work together to make this one of the first packages available.
Android-srudio will fail to compile when path is long. And although I had my project only two levels from from root, but because there were files like gesture\LongPressGestureRegonizer.cpp made over all path very long and that just caused android studio to stop compiling. So i shortened the names to only LPressGR.cpp and without Gesture directory and it worked (offcourse I did this to all files and updated references)