Modifiers
Modifiers modify the rendered image in elements and groups.
All modifiers have properties which can be animated.
All modifiers inherit from graphics.modifiers.Modifier
To write your own modifiers, please look at Extending Graphic Videos.
Base Modifier API
Modifier.__init__
- Base modifier init. Other modifiers should have their own init and call
super().__init__()
.
- Base modifier init. Other modifiers should have their own init and call
Modifier.modify(src, frame)
:- This function is called by the scene when rendering. All this function does is remove alpha from the surface and call
modify_raw
. - Parameter
src
: Source surface. - Parameter
frame
: Frame to modify. This changes property values. - Return:
pygame.Surface
- This function is called by the scene when rendering. All this function does is remove alpha from the surface and call
Modifier.modify_raw(src, frame)
- Empty method. Other modifiers should define their own.
- This is the method that applies effects to the surface.
- Parameter
src
: Source surface. - Parameter
frame
: Frame to modify. This changes property values. - Return:
pygame.Surface
Pre-written Modifiers
Examples include Blur, Flip, and Brighten.
- Flip
- MixSolidColor
- GaussianBlur
- Grayscale
- Bright
- Contrast
- ColorEnhance
- Sharpen
- Invert