
- Returns a texture object
obj:
- game object
- Type: KX_GameObject
- index number of game object’s material.
- Type: integer
- index number of object’s texture.
- Type: integer
- Use same VideoTexture Texture on a different game object.
- Type: VideoTexture Texture
- Returns a texture object
obj:
- game object
- Type: KX_GameObject
- index number of game object’s material.
- Type: integer
- index number of object’s texture.
- Type: integer
Note:
- Uses the default value of 0 (zero) for objTex.
- Returns a texture object
obj:
- game object
- Type: KX_GameObject
- index number of game object’s material.
- Type: integer
Note:
- Uses the default values of 0 (zero) for texID and objTex.
- Returns a texture object
obj:
- game object
- Type: KX_GameObject
Note:
- Uses the default values of 0 (zero) for matID, texID and objTex.

###################### Video Texture Texture
# import bge module
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get list of objects in scene
objList = scene.objects
# get object to render to
# my object is named Security_Monitor
obj = objList["Security_Monitor"]
# get the Security_Monitor material ID
# Name of my render material is Screen
matID = bge.texture.materialID(obj, "MAScreen")
# use the first texture slot
texID = 0
# use the default objTex value
# set the texture
viewport_texture = bge.texture.Texture(obj, matID, texID)
# get the texture image
viewport_texture.source = bge.texture.ImageViewport()
# save as an object property
obj["image_viewport"] = viewport_texture
# update texture
viewport_texture.refresh(True)