Jump to content

Can Container get touchup event when 'touchdown' of Other Container press?


GBear
 Share

Recommended Posts

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.log

touchstart 0 0touchend 2 0touchend 0 0

Child2 is not pressed but it get 'touchend' 

 

 

i don't wanna get not pressed continaer's event 

how can i fix it?

 

thx..

 

Link to comment
Share on other sites

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 _touchDown

so 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 

Link to comment
Share on other sites

i think it have to change  like this

InteractionManager.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..

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...