Basic Tweening library compatible with DefaultEcs #194
bootzin
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all
Just wanted to share something I've been working on.
I managed to create a dynamic Tweening library that works nicely along DefaultEcs. It uses quite a bit of reflection, so maybe not the best for performance, but the usability is very simple and it works with any value-property from Components. I'm also somewhat confident it doesn't do any copies nor any boxing, but I might be wrong in that regard since I'm somewhat new to the scene. Please let me know if you have any critics or suggestions!
Usage was one of my main concerns, so I tried to make it as simple and as versatile as possible. Here is how you would create a tween for a
TransformComponent
to update both its Position and Scale:And this in your update loop:
The code to make that possible is a bit more complicated, but this is the Tween class itself:
And here is a Tweener to manage those Tweens:
Let me know your thoughts and if you have any changes/improvements to suggest!
Beta Was this translation helpful? Give feedback.
All reactions