Replies: 1 comment
-
@lassade has done some work on related lines in #1770 and https://github.com/lassade/bevy_gizmos I believe :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
I’m writing this thread to advocate for a UI animation approach based on springs. From the popular js library react-spring:
Usage
As usual, the user specifies key values to interpolate from and to. These keys are provided with a spring value, which describes interpolation in terms of forces and resistance. The animation system generates the actual timings and interpolates values from the spring. This abstraction helps ensure the end animation moves in a natural way.
Implementation
Springs can be implemented on top of other lower-level animation APIs. A pure function can map a spring value to other kinds of values, including curves or a simple collection of key values. In some cases, this mapping could even be done ahead of time in a build step, which would allow a ‘zero-cost’ implementation. In cases where the parameters aren’t known at build time (or if the mapping isn’t expensive) this mapping can happen during runtime.
Beta Was this translation helpful? Give feedback.
All reactions