
- set/get the background color for the mirror image.
Type:
- RGBA integer list: [ r, g, b, a]
a:
- alpha color channel
- Type: integer
- Range: 0 to 255
- blue color channel
- Type: integer
- Range: 0 to 255
- green color channel
- Type: integer
- Range: 0 to 255
- red color channel
- Type: integer
- Range: 0 to 255

###################### get background color
# import bge module
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get list of objects in scene
objList = scene.objects
# get object named Mirror
obj = objList["Mirror"]
# get the mirror material ID
# Name of my Mirror material is Reflect
matID = bge.texture.materialID(obj, "MAReflect")
# get a list of the cameras
camList = scene.cameras
# get the camera named PlayerOne
cam = camList["PlayerOne"]
# texture I'm using for the mirror is in first texture channel
texChannel = 0
# get the texture
mirror = bge.texture.Texture(obj, matID, texChannel)
# get the mirror source
mirror.source = bge.texture.ImageMirror(scene, cam, obj, matID)
# get the background color
col = mirror.source.background
# save mirror as an object variable
obj["Mirror"] = mirror
# update mirror
mirror.refresh(True)
###################### set background color
# import bge module
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get list of objects in scene
objList = scene.objects
# get object named Mirror
obj = objList["Mirror"]
# get the mirror material ID
# Name of my Mirror material is Reflect
matID = bge.texture.materialID(obj, "MAReflect")
# get a list of the cameras
camList = scene.cameras
# get the camera named PlayerOne
cam = camList["PlayerOne"]
# texture I'm using for the mirror is in first texture channel
texChannel = 0
# get the texture
mirror = bge.texture.Texture(obj, matID, texChannel)
# get the mirror source
mirror.source = bge.texture.ImageMirror(scene, cam, obj, matID)
# set background color to red
mirror.source.background = [255, 0, 0, 255]
# save mirror as an object variable
obj["Mirror"] = mirror
# update mirror
mirror.refresh(True)