animatable¶
Classes
Base class for anything that needs animation. |
|
A container for all of the animation-relevant data for a mob, including its ModificationHistory. |
|
A complete record of every change applied to a particular Mob, and the timestamps those changes occur over. |
|
Functions
- animated_function(function=None, *, animated_args={}, unique_args=[])[source]¶
Decorator that turns a function into an animated function. The animation is created by interpolating all args named in the animated_args dict from the value provided in this dict the value passed as an actual argument when the function is called. Most commonly, animated_args will just be {‘t’: 0}, and the function will be called with t=1.
- Parameters:
function – The function to be decorated. It MUST accept a
Mob
as its first argument, and any arguments given in animated_args or unique_args must also be arguments of this function.animated_args (Dict[str, float]) – A dictionary with strings as keys and floats as values. The strings are names of arguments which will be animated. The arguments will be animated by linearly interpolating their values from the corresponding value provided in the animated_args dict to the value they have when the function is called.
unique_args – A list of strings. This is only for batching, when the function is called with different values for a unique argument, they will be batched as two entirely separate functions. Any arguments named in unique_args MUST only accept string values.