GBear Posted December 15, 2015 Share Posted December 15, 2015 hi. this is sample.. http://jsfiddle.net/gbear/p2owbd23/19/ you can test like first. touch Parent Sprite second move to Child2 with Touched Third touch up and then you can see like this console.logtouchstart 0 0touchend 2 0touchend 0 0Child2 is not pressed but it get 'touchend' i don't wanna get not pressed continaer's event how can i fix it? thx.. Quote Link to comment Share on other sites More sharing options...
GBear Posted December 16, 2015 Author Share Posted December 16, 2015 hi. everyone.... pixi.js seems not to guarantee about touchend call by corrent identifier.. normally touchend will be matched with touchstart by identifier if touchstart of 'identifier_1' called , touchend of 'identifier_1'called . but it's maybe not... becuase processTouchEnd is not check about identifier.. only check _touchDownso i can't get correct event by identifier .InteractionManager.prototype.processTouchEnd = function ( displayObject, hit ){ if(hit) { this.dispatchEvent( displayObject, 'touchend', this.eventData ); if( displayObject._touchDown ) { displayObject._touchDown = false; this.dispatchEvent( displayObject, 'tap', this.eventData ); } } else { if( displayObject._touchDown ) { displayObject._touchDown = false; this.dispatchEvent( displayObject, 'touchendoutside', this.eventData ); } }};for example identifier_0 touched, identifier_1 touched, identifier_1 touched off, in this case I can get touchend event of identifier_0; and identifier_0 touched off i can't get any event. i think there need to check identifier when touchend called how do you think? thx a lot Quote Link to comment Share on other sites More sharing options...
GBear Posted December 16, 2015 Author Share Posted December 16, 2015 i think it have to change like thisInteractionManager.prototype.processTouchStart = function ( displayObject, hit ){ //console.log("hit" + hit) if(hit) { displayObject._touchDown = true; //save identifier to check touchend displayObject._touchIdentifier = this.eventData.data.identifier; this.dispatchEvent( displayObject, 'touchstart', this.eventData ); }};InteractionManager.prototype.processTouchEnd = function ( displayObject, hit ){ if(hit) { this.dispatchEvent( displayObject, 'touchend', this.eventData ); //if( displayObject._touchDown) if( displayObject._touchDown && displayObject._touchIdentifier == this.eventData.data.identifier) { displayObject._touchDown = false; displayObject._touchIdentifier = -1; this.dispatchEvent( displayObject, 'tap', this.eventData ); } } else { //if( displayObject._touchDown) if( displayObject._touchDown && displayObject._touchIdentifier == this.eventData.data.identifier) { displayObject._touchDown = false; displayObject._touchIdentifier = -1; this.dispatchEvent( displayObject, 'touchendoutside', this.eventData ); } }};it was normal when I tested thx.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.