You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
My use-case is this: I have an animation coroutine that has different stages, like it plays one animation after another. One of them is a simple simple LERPed rotation. However, that LERP function needs the delta time of the update. Is there an easy way to achieve what I want, that I just haven't figured out? If not, maybe you could add a small function like
If I'm understanding your request, you can just use whatever delta time-measuring functions you normally have at your disposal (a global delta time variable or function, calculating 1/TPS for Ebitengine, etc). Yielding in a coroutine pauses execution for some amount of time, but that doesn't change the delta value between game frames.
QUICK EDIT: To give an example, if you have this animation coroutine, then you could use YieldFunc to create a function literal that yields execution until the animation is finished. You can call update on the animation in that literal, and pass whatever delta calculation / constant / value you normally would.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Thanks for this nice little piece of code :)
My use-case is this: I have an animation coroutine that has different stages, like it plays one animation after another. One of them is a simple simple LERPed rotation. However, that LERP function needs the delta time of the update. Is there an easy way to achieve what I want, that I just haven't figured out? If not, maybe you could add a small function like
YieldDeltaFunc(deltaFunc func(deltaTime float64) bool) error
The text was updated successfully, but these errors were encountered: