Filter 2D Actuator Blur: mode

mode
  • gets/sets the type of 2D filter

Type: 
  • integer

Values:

  • -2 = Filter Enabled
     
  • -1 = Filter Disabled
     
  •  0 = No Filter
     
  •  1 = Motion Blur
     
  •  2 = Blur
     
  •  3 = Sharpen
     
  •  4 = Dilation
     
  •  5 = Erosion
     
  •  6 = Laplacian
     
  •  7 = Sobel
     
  •  8 = Prewitt
     
  •  9 = Grayscale
     
  • 10 = Sepia
     
  • 11 = Invert
     
  • 12 = Custom Filter
Note:
  • The Blur Actuator decreases the contrast between differing pixels.
     
  • 2D Filters are applied to everything in the Scene.  Not just to the object they are attached to.
Sample Code


################  Get the type of 2D Filter being used

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the actuator attached to the controller
# my actuator is named Visor

act = cont.actuators["Visor"]

# get 2D filter type
type = act.mode
 
Sample Code


################  Set the 2D Filter being used

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the actuator attached to the controller
# my actuator is named Visor

act = cont.actuators["Visor"]

# set the 2D Filter to Motion Blur
act.mode = 1