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

feat(scintillator/animation): Keyframe-based animation #84

Merged
merged 6 commits into from
Feb 3, 2015
Merged

Conversation

dtinth
Copy link
Member

@dtinth dtinth commented Feb 3, 2015

I found a library called "keytime" that does exactly what I need:
given a set of keyframes and the time, return the state of the animation.

An animation can work like this:

sprite(...)
  animation
    keyframe(t='0' x='-100')
    keyframe(t='1' x='0')
  animation(on='exitEvent')
    keyframe(t='0' x='0')
    keyframe(t='1' x='1000')

Here, there are two animations. The first one is the default animation, and the
second one is the "on exit" animation.

Which animation to use is selected based on latest event. An event is the
timestamp in the data passed to render() of the specified key.

{ t: 1.5, exitEvent: 1.2 }

This means the exitEvent has happened 0.3 seconds ago, so the exit animation
should be performed.

Closes #78

I found a library called "keytime" that does exactly what I need:
given a set of keyframes and the time, return the state of the animation.

An animation can work like this:

```jade
sprite(...)
  animation
    keyframe(t='0' x='-100')
    keyframe(t='1' x='0')
  animation(on='exitEvent')
    keyframe(t='0' x='0')
    keyframe(t='1' x='1000')
```

Here, there are two animations. The first one is the default animation, and the
second one is the "on exit" animation.

Which animation to use is selected based on latest event. An event is the
timestamp in the data passed to `render()` of the specified key.

    { t: 1.5, exitEvent: 1.2 }

This means the exitEvent has happened 0.3 seconds ago, so the exit animation
should be performed.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.19%) to 98.97% when pulling 8e92429 on keytime into a3a7bc3 on master.

dtinth added a commit that referenced this pull request Feb 3, 2015
feat(scintillator/animation): generate keyframes from xml
@dtinth dtinth merged commit 52a7855 into master Feb 3, 2015
@dtinth dtinth changed the title feat(scintillator/animation): generate keyframes from xml feat(scintillator/animation): Keyframe-based animation Feb 3, 2015
@dtinth dtinth deleted the keytime branch February 4, 2015 04:39
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.

Scintillator Animations
2 participants