I found a bug on android input handling.
I fixed it in Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd from:
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd(JNIEnv* env, jobject thiz, jint id, jfloat x, jfloat y)
{
CCRect rcRect = CCEGLView::sharedOpenGLView().getViewPort();
float fScreenScaleFactor = CCEGLView::sharedOpenGLView().getScreenScaleFactor();
CCSet set;
/* Add to the set to send to the director */
CCTouch* pTouch = s_pTouches[id];
if (pTouch)
{
LOGD("Ending touches with id: %d, x=%f, y=%f", id, x, y);
pTouch->SetTouchInfo(0, (x - rcRect.origin.x) / fScreenScaleFactor , (y - rcRect.origin.y) / fScreenScaleFactor);
set.addObject(pTouch);
// release the object
pTouch->release();
s_pTouches[id] = NULL;
cocos2d::CCDirector::sharedDirector()->getOpenGLView()->getDelegate()->touchesEnded(&set, NULL);
} else {
LOGD("Ending touches with id: %d error", id);
}
}
to
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd(JNIEnv* env, jobject thiz, jint id, jfloat x, jfloat y)
{
CCRect rcRect = CCEGLView::sharedOpenGLView().getViewPort();
float fScreenScaleFactor = CCEGLView::sharedOpenGLView().getScreenScaleFactor();
CCSet set;
/* Add to the set to send to the director */
CCTouch* pTouch = s_pTouches[id];
if (pTouch)
{
LOGD("Ending touches with id: %d, x=%f, y=%f", id, x, y);
pTouch->SetTouchInfo(0, (x - rcRect.origin.x) / fScreenScaleFactor , (y - rcRect.origin.y) / fScreenScaleFactor);
set.addObject(pTouch);
cocos2d::CCDirector::sharedDirector()->getOpenGLView()->getDelegate()->touchesEnded(&set, NULL);
// release the object
pTouch->release();
s_pTouches[id] = NULL;
} else {
LOGD("Ending touches with id: %d error", id);
}
}
Best Regards.