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

translateX, translateY, rotateX, rotateY, etc. #37

Open
knod opened this issue Aug 23, 2015 · 2 comments
Open

translateX, translateY, rotateX, rotateY, etc. #37

knod opened this issue Aug 23, 2015 · 2 comments

Comments

@knod
Copy link

knod commented Aug 23, 2015

I noticed that in the input example (http://lvivski.com/anima/example/keyboard_mixed.html) you have code to make sure that only one axis is affected at a time:

a.translate = translate.map(function(t, i) { return t || a.translate[i] })

It's a functionality that I often need when I'm coding for user interaction. It might be nice if that were built into the library so that a user wouldn't have to do it themselves each time they wanted to affect only a single axis. If there was the option to translate, rotate, scale, etc. for each axis (translateX, scaleY, rotateZ, etc.), it could really help.

@lvivski
Copy link
Owner

lvivski commented Aug 24, 2015

I've never actually designed anima for interactive animations (when you change them based on user input) but I like the idea. I think I can modify existing .translate() .rotate(). scale() methods to support a second argument as dutation. So you'll get the same API, but if you provide a duration it would modify existing or add a new animation.

@knod
Copy link
Author

knod commented Aug 28, 2015

Thanks for the response. Actually, my point wasn't about duration, it was about the ability to isolate one axis instead of having to pass all the values at once. The way it currently is, you have to calculate the value for each axis, making sure not to change ones that don't need changing. If you could just change one axis without affecting the others at all, that would be something I would find very useful.

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

No branches or pull requests

2 participants