Created
December 27, 2013 14:14
-
-
Save baku89/8147453 to your computer and use it in GitHub Desktop.
一定時間かけて直前のキーフレームの値にアニメーションします。F.I F.Oを繰り返す時などに使えます。 duration: アニメーションの長さ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var duration = 1; | |
if (thisProperty.numKeys < 2) { | |
value | |
} else { | |
var pk = nearestKey(time); | |
(pk.index > 1 && time < pk.time) ? pk = thisProperty.key(pk.index-1) : false; | |
if (time - pk.time < duration && pk.index > 1) { | |
ease(time, pk.time, pk.time+duration, thisProperty.key(pk.index-1).value, pk.value); | |
} else { | |
pk.value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment