HI,
When i run my game on PC, or Web, the touch event works, but when i run on native android, everything works fine except for the touch event !
Here is my touch event code:
setTouchTrack () : void { cc.eventManager.addListener({ event: cc.EventListener.TOUCH_ONE_BY_ONE, onTouchBegan: (touch, event) => { this.node.x += 10 return true; }, onTouchMoved: (touch, event) => { this.node.x -= 2 console.log('Touch moved !') }, onTouchEnded: (touch, event) => { console.log('Touch end !') } }, this.node); this.node.on(cc.Node.EventType.TOUCH_START, (e) => this.node.x += 10) this.node.on('touchstart', (e) => this.node.x += 10) }
Like you can see, i tried everything for my touch event to works, i’m stuck on this since 3 / 4 hours !
The node that handle touch event is a sprite that take all screen, and i can see it when i run my game, but when i touch it, nothing happens, except when i touch it with PC / Web build…
I have debugged my app and i found this log:
05-26 15:39:43.180 3486-3510/? E/cocos2d-x: cocos2d: warning, Director::setProjection() failed because size is 0 05-26 15:39:43.225 3486-3510/? D/cocos2d-x: cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file. 05-26 15:39:43.272 3486-3486/? D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true 05-26 15:39:43.312 3486-3510/? D/cocos2d-x: cocos2d: fullPathForFilename: No file found at script/jsb_boot.jsc. Possible missing file. 05-26 15:39:43.317 3486-3510/? D/cocos2d: android SDK version:23 05-26 15:39:43.665 3486-3510/? D/cocos2d-x debug info: Cocos2d-JS v3.14
then, this:
05-26 15:40:43.141 3486-3510/org.cocos2d.helloworld I/libGameXtend: LUCID_1 (1495806043141) GameXtend is currently running in Manual mode 05-26 15:40:43.141 3486-3510/org.cocos2d.helloworld I/libGameXtend: LUCID_1 (1495806043141) GameXtend is currently running in no_save Save power state. 05-26 15:40:43.141 3486-3510/org.cocos2d.helloworld I/libGameXtend: LUCID_1 (1495806043141) org.cocos2d.helloworld is currently running with GameXtend, with PS parameter = 1. , ICE is not supported. PS parameter source is PowerXtend configuration 05-26 15:40:43.141 3486-3510/org.cocos2d.helloworld I/libGameXtend: LUCID_1 (1495806043141) PowerXtend touch feature is not active
Did i miss something ? Is there something that i haven’t did ?
I really need help guys ! :’(
Thanks !