Get your graphics "on the move" with this Animation library that uses CircuitPython's displayio to make buttery-smooth animations for your LCD/TFT display or LED matrix.
Here is the animation from the example:
Here is a longer form animation that includes the color morphing:
There are three steps required to get your Animation going:
- Create the graphical elements and put them into groups, organize the groups depending upon which elements will be move together or separately.
- Instance an `Animation()` object and create the animation entries using add_entry() with all the desired parameters, including the starting and ending frames, the function for animating your object and all the relevant parameters for that function.
- Several initial animation functions are provided:
- translate - Move the group between two (x1,y1) and (x2,y2) locations with options for "easing" functions to make cool animations
- translate_relative - Move from the initial position by (delta_x, delta_y), also with options for easing functions
- wiggle - make some nervous jittery motion while generally staying in one spot
- color_morph_vector_shape - morph between a starting and ending color for a vector shape
- color_morph_label - morph between a starting and ending color for a text label
- color_morph_palette - morph between a starting palette of colors all to a single ending color (usually used for a bitmap)
- Add your own functions, maybe morphing colors, rotation or changing the shape altogether as it moves.
- You can combine animations over the same frames, try it out and see what you can discover!
- Several initial animation functions are provided:
- Make a `while` loop that calls execute_frame() for each frame.
- Enjoy watching your animation.
- Bonus: Try different settings for the "easing" to get all kinds of smooth and creative animations.
Example: Here is an example showing how to use these Animations
Documentation Go check out the documentation with more details how to use these animation tools with displayio.
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
See scripts in the examples directory of this repository.
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
For information on building library documentation, please check out this guide.