KX_2DFilterManager(EXP_PyObjectPlus)#
base class — EXP_PyObjectPlus
- class KX_2DFilterManager(EXP_PyObjectPlus)#
2D filter manager used to add, remove and find filters in a scene.
- addFilter(index, type, fragmentProgram)#
Add a filter to the pass index
index
, typetype
and fragment program if custom filter.- Parameters:
index (integer) – The filter pass index.
type (integer) –
The filter type, one of:
bge.logic.RAS_2DFILTER_BLUR
bge.logic.RAS_2DFILTER_DILATION
bge.logic.RAS_2DFILTER_EROSION
bge.logic.RAS_2DFILTER_SHARPEN
bge.logic.RAS_2DFILTER_LAPLACIAN
bge.logic.RAS_2DFILTER_PREWITT
bge.logic.RAS_2DFILTER_SOBEL
bge.logic.RAS_2DFILTER_GRAYSCALE
bge.logic.RAS_2DFILTER_SEPIA
bge.logic.RAS_2DFILTER_CUSTOMFILTER
fragmentProgram (string) – The filter shader fragment program. Used only if
type
isbge.logic.RAS_2DFILTER_CUSTOMFILTER
, if empty or not specified the filter is created without shader, waiting call toBL_Shader.setSourceList
. (optional)
- Returns:
The 2D Filter.
- Return type:
- removeFilter(index)#
Remove filter to the pass index
index
.- Parameters:
index (integer) – The filter pass index.
- getFilter(index)#
Return filter to the pass index
index
.- Warning:
If the 2D Filter is added with a
SCA_2DFilterActuator
, the filter will be available only after the 2D Filter program is linked. The python script to get the filter has to be executed one frame later. A delay sensor can be used.- Parameters:
index (integer) – The filter pass index.
- Returns:
The filter in the specified pass index or None.
- Return type:
KX_2DFilter
or None