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

How to delicately remove the nipple? #6

Closed
JSteunou opened this issue Sep 9, 2015 · 7 comments
Closed

How to delicately remove the nipple? #6

JSteunou opened this issue Sep 9, 2015 · 7 comments
Labels
Milestone

Comments

@JSteunou
Copy link

JSteunou commented Sep 9, 2015

First, kudos for this tool!

I have a need to create 2 nipples, on the same el, the second after shutting down the first, with some other parameters. Or maybe there is a way to change a nipple size after initialisation?

@yoannmoinet
Copy link
Owner

Thanks a lot !

I'm not sure to understand your setup.

You have an element, on which you'd like to instantiate 2 nipples.

Each one activated via multitouch I guess? 1 finger, 1 nipple. (:smile: this name makes some funny conversation...)

If you need to create 2 nipples on the same element, maybe you could create two zones inside this element, and then create one nipple on each zone?

Be aware that there are still bugs with the multitouch, that I have to tackle.

@JSteunou
Copy link
Author

That's not my issue sorry I did not explain it very well.

I have 2 needs, both I though could be resolved by destroying the instance.

1/ I create a nipple instance on an element but after a certain user action I need to remove that instance. Totally. Forever.
2/ On another case, totally different from the 1st, I create a nipple instance but after a certain event I need to increase it's size. Which I managed differently by updating the options.size. I did not know that updating options after the instance was creating works, that's why I though about destroy / re-create.

That left my 1st case unsolved at the moment.

@yoannmoinet yoannmoinet added this to the 0.4.0 milestone Sep 10, 2015
@yoannmoinet
Copy link
Owner

Ok, that's a fair point.
I'll push this into the milestone and find a way to deal with this.

Instances will be more explicit and controllable.

@JSteunou
Copy link
Author

Thank you :)

@JSteunou
Copy link
Author

@yoannmoinet I just tested your 0.4.x release, I'm sorry but issue 2/ is worse with it :(

To sum it up

  • I create a joystick (which is now a manager) with a specified size
  • Some times the size is not correct because other things happens and I need to set a new size.
  • With 0.3.0 I just had to update joystick.options.size and it worked
  • With 0.4.0 I do not have access to size so I call .off on old manager and create a new one with the new size.
  • Kitten dies: nipple show me a force Infinity. I suppose this was because sometimes my first size is 0. But since I create a new manager with a new correct size (like 600), why on earth the old size would influence the new manager (and new nipples).

@JSteunou
Copy link
Author

Find a tail: old manager is still bind to move events. The same old manager that have size to 0. How can I cleanly destroy the manager so all events are unbind?

@yoannmoinet
Copy link
Owner

If you need to dynamicly update the size options on the manager we could add its nippleOptions to its exported signature.

Would this fix your issue? At least we'd go back to where we were in the 0.3.0. And you'd be able to modify any new nipple instanciated.

What do you think?

We still need your .destroy() method though. It's a great feature.

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

No branches or pull requests

2 participants