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

enableDrag doesn't take anchor into account #1593

Closed
unindented opened this issue Feb 1, 2015 · 2 comments
Closed

enableDrag doesn't take anchor into account #1593

unindented opened this issue Feb 1, 2015 · 2 comments

Comments

@unindented
Copy link

If I have the following:

paddle.anchor.setTo(0.5);

paddle.inputEnabled = true;
paddle.input.setDragLock(false, true);
paddle.input.enableDrag(false, false, false, false, this.game.world.bounds);

I can only drag my paddles so far down:

screen shot 2015-02-01 at 19 09 52

The opposite happens when I drag up: the paddles are able to move beyond the world boundaries by half their height.

If I comment out paddle.anchor.setTo(0.5) then everything works as expected.

Is this a bug in enableDrag, or am I supposed to deal with it in my code?

photonstorm added a commit that referenced this issue Feb 16, 2015
…the Sprites anchor when limiting the drag (thanks @unindented #1593)

InputHandler.enableDrag with a boundsSprite set now takes into account both the Sprites anchor and the boundsSprite anchor when limiting the drag.
@photonstorm
Copy link
Collaborator

Yeah I had been waiting for a new major release to address this one, as it's a bit of an API change. But this is now covered in 2.3.

@unindented
Copy link
Author

👍

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