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

IGenericActuator: added goto() method that can manually change the current position #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joshtynjala
Copy link
Member

Sometimes, I want to pause a tween and control it manually instead of letting it update automatically every frame. For instance, I might want to change the current position based on a Slider or another type of UI, like you would with video or audio.

Example usage

var actuator = Actuate.tween(target, duration, props);
Actuate.pause(actuator);
actuator.goto(0.5);

@jgranick
Copy link
Member

How do you feel about using seek and time rather than using a ratio?

Also, I wonder if seeking should permanently affect the tween, like:

Actuate.tween(target, 2, props);
Actuate.seek(target, 1, props);
// 1 second remaining on the tween before complete

...I suppose this method might not work properly for rewinding or would trigger completion events when someone might want to be able to update to the end of the tween and back

This does raise an interesting question though of using Actuate with local instances rather than the global approach. I almost wish we could have local and global methods with the same name (like in AS3) so new Actuate().tween or Actuate.tween would both work.

@joshtynjala
Copy link
Member Author

Yeah, seek/time would be fine by me. It's not a big deal if I need to manually convert between ratio/time.

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

Successfully merging this pull request may close these issues.

2 participants