Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

touchmove not called until last added object is touched and moved #785

Closed
ghost opened this issue Jun 9, 2014 · 2 comments
Closed

touchmove not called until last added object is touched and moved #785

ghost opened this issue Jun 9, 2014 · 2 comments
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Milestone

Comments

@ghost
Copy link

ghost commented Jun 9, 2014

I have an object that contains a Sprite and I set that sprite to be interactive and set all the interaction callbacks however when I add a few of them to my scene I must touch the last added one before the other's will send the touchmove event (touchstart, and touched are still being called).

The mouse events are called fine when played in a browser, this issue arises when I play on my iOS devices.

  • Not included here is the positioning and adding to the screen code, it is being added and positioned fine; I only included the relevant interaction code*

MySprite

NameSpace.MySprite = function()
{
    this.selected = this.selected.bind(this);
    this.dragged = this.dragged.bind(this);
    this.deselected = this.deselected.bind(this);

    this.sprite = PIXI.Sprite.fromFrame("sprite01.png");
    this.sprite.interactive = true;
    this.sprite.mousedown = this.sprite.touchstart = this.selected;
    this.sprite.mousemove = this.sprite.touchmove = this.dragged;
    this.sprite.mouseup = this.sprite.mouseupoutside = this.sprite.touchendoutside =     this.sprite.touchend = this.deselected;
}
NameSpace.MySprite.prototype.constructor = NameSpace.MySprite;

NameSpace.MySprite.prototype.selected = function(data)
{
    this.data = data;
    this.dragging = true;
};
NameSpace.MySprite.prototype.dragged = function()
{
    if(this.dragging)
    {
        this.destinationX = this.data.getLocalPosition(this.container).x;
    }
};
NameSpace.MySprite.prototype.deselected = function()
{
    this.destinationX = this.sprite.position.x;
    this.dragging = false;
    this.data = null;
};

Create MySprites

this.sprites = [];

var sprite = null;
for(var i = 0, spriteCount = 5; i < spriteCount; i++)
{
    sprite = new NameSpace.MySprite();
    this.sprites.push(sprite);
}
@englercj englercj mentioned this issue Dec 26, 2014
@englercj englercj added Interaction Manager 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. labels Jan 24, 2015
@englercj englercj added this to the v3.x milestone Jan 24, 2015
@GoodBoyDigital
Copy link
Member

closing this one as pretty sure this issue has been resolved in v3. let me know if i'm wrong 👍 cheers all!

@lock
Copy link

lock bot commented Feb 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Projects
None yet
Development

No branches or pull requests

2 participants