Last active
January 24, 2020 10:36
-
-
Save pranaybinju/40428d36be240f9077a60b2c25ee11b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function runTiming(clock, value, dest) { | |
const state = { | |
finished: new Value(0), | |
position: value, | |
time: new Value(0), | |
frameTime: new Value(0), | |
}; | |
const config = { | |
duration: 1000, | |
toValue: dest, | |
easing: Easing.inOut(Easing.cubic), | |
}; | |
return block([ | |
cond(clockRunning(clock), 0, [ | |
set(state.finished, 0), | |
set(state.time, 0), | |
set(state.position, value), | |
set(state.frameTime, 0), | |
set(config.toValue, dest), | |
startClock(clock), | |
]), | |
timing(clock, state, config), | |
cond(state.finished, debug('stop clock', stopClock(clock))), | |
state.position, | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment