Hi guys,
having an bit of an issue with go.animate, wondered if anyone had a solution?
So, here’s two pieces of code:
go.animate(".", "position.y", go.PLAYBACK_ONCE_FORWARD, tar_pos, go.EASING_LINEAR, self.bst_out_dur, 0,
go.animate(".", "position.y", go.PLAYBACK_ONCE_FORWARD, self.position.y, go.EASING_LINEAR, self.bst_rtn_dur, self.bst_hov_dur,
function()
print("returning to neutral")
state = neutral
end))
this works perfectly, but if this becomes more complex, I want to break it down into stages and simply pass in a function to [complete_function] parameter of go.animate.
go.animate(".", "position.y", go.PLAYBACK_ONCE_FORWARD, tar_pos, go.EASING_LINEAR, self.bst_out_dur, 0,
go.animate(".", "position.y", go.PLAYBACK_ONCE_FORWARD, self.position.y, go.EASING_LINEAR, self.bst_rtn_dur, self.bst_hov_dur,
animate_boost_done(self)))
If I use this, the same piece of code except I’m passing in a function instead of writing a function to pass as the parameter, it calls the function immediately rather than waiting until the animation is done.