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

Offer a less verbose approach to adding tweens to a Timeline #14

Open
WesWedding opened this issue Nov 6, 2017 · 1 comment
Open

Offer a less verbose approach to adding tweens to a Timeline #14

WesWedding opened this issue Nov 6, 2017 · 1 comment

Comments

@WesWedding
Copy link
Owner

Nothing is explicitly wrong with timeline.add(*TweenDuino::Tween::to(brightness,50UL, 255.0));
but it's super verbose but all the namespace/scoping junk is confusing to a novice coder.

timeline.addTo(brightness, 255.0, 50) is a lot clearer. We're adding a tween to of the "brightness" variable to 55.0 that will take 50 milliseconds. It's a line half as long, without someone needing to understand what all that TweenDuino::Tween stuff is or telling someone to add using namespace TweenDuino to their files just to use our lib.

@WesWedding
Copy link
Owner Author

Why not just remove the reference from each add() call, too? Set the reference in the constructor and just make things even more simple with timeline.addTo(255.0, 50)

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

1 participant