Pygame Animation Library

Progress 100%

Installation

Just like every other python package, you can install this with pip. This package comes bundled in with PygameUILib so to install this package you need to run:

Documentation

Class: AnimatableValue

Variables

Method or Variable Description Type Default
AnimatableValue.value
Starting value for animatable value
Any (Tested with: int, float, pygame.Color)
0
For example

I hear you thinking: why not use a regular value in an animation? That’s because regular integers and floating point numbers are immutable, meaning: you cant edit the variable’s content from an external library without doing a return call, which will make it too difficult and cluttered to code for, and one of my requirements for this library was that it had to be easily understandable. By creating an object (AnimatableValue) and storing the variable inside that object is more efficient and is much easier to understand while still being a mutable variable.

Class: Animation

Method or Variable Description Type Default
Animation.AnimValue
Starting value for animatable value
Any (Tested with: int, float, pygame.Color)
0
Animation.OnStart
Call a function when the animation starts
Lambda Function
None
Animation.Step
Call function every single frame of the animation
Lambda Function
None
Animation.OnEnd
Call a function when the animation ends
Lambda Function
None
Animation.Ease
The type of smoothing the animation uses
EaseTypes (Enum)
EaseTypes.NONE