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

BUG: dragend after setting dragDistanceThreshold or dragTimeThreshold #3686

Closed
RollinSafary opened this issue May 21, 2018 · 1 comment
Closed

Comments

@RollinSafary
Copy link

RollinSafary commented May 21, 2018

Phaser v3.8.0

var config = {
    type: Phaser.WEBGL,
    parent: 'phaser-example',
    scene: {
        preload: preload,
        create: create
    }
};

var game = new Phaser.Game(config);

function preload ()
{
    this.load.image('eye', 'assets/pics/lance-overdose-loader-eye.png');
}

function create ()
{
    var image = this.add.sprite(200, 300, 'eye').setInteractive();

    this.input.setDraggable(image);

    //  The pointer has to move 16 pixels before it's considered as a drag
    this.input.dragDistanceThreshold = 50;
    this.input.dragTimeThreshold = 200; // or/or-with

    this.input.on('dragstart', function (pointer, gameObject) {
        console.warn('dargStart');
        gameObject.setTint(0xff0000);

    });

    this.input.on('drag', function (pointer, gameObject, dragX, dragY) {
        console.warn('drag');
        gameObject.x = dragX;
        gameObject.y = dragY;

    });

    this.input.on('dragend', function (pointer, gameObject) {
        console.warn('dargend');
        gameObject.clearTint();

    });
}

after clicking on the sprite
i see in console dragEnd

it seems bug

@RollinSafary RollinSafary changed the title BUG: dragend after setting dragDistanceThreshold BUG: dragend after setting dragDistanceThreshold or dragTimeThreshold May 22, 2018
@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants