Skip to content

Get your graphics on the move with this Animation library that uses displayio to make buttery-smooth animations for your display or LED matrix

License

Notifications You must be signed in to change notification settings

kmatch98/CircuitPython_DisplayIO_Animation

Repository files navigation

Introduction

Documentation Status Discord Build Status Code Style: Black

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:

Graphic showing the animated simpletest example in action.

Here is a longer form animation that includes the color morphing:

A longer form animation.

Usage

There are three steps required to get your Animation going:

  1. Create the graphical elements and put them into groups, organize the groups depending upon which elements will be move together or separately.
  2. 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!
  3. Make a `while` loop that calls execute_frame() for each frame.
  4. Enjoy watching your animation.
  5. 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.

Dependencies

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.

Usage Example

See scripts in the examples directory of this repository.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Documentation

For information on building library documentation, please check out this guide.

About

Get your graphics on the move with this Animation library that uses displayio to make buttery-smooth animations for your display or LED matrix

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages