<multimedia:image>.load

This will change the image associated with the texture

 

<multimedia:image>.load(
    filename    
    face = viz.POSITIVE_X    

)

 

filename

The filename of the new image to load


face = viz.POSITIVE_X

This is an optional argument used only with Cube Mapped or 3D textures.

With Cube Mapped textures it specifies which face of the cube to apply the image to. This can be one of the following values:

viz.POSITIVE_X
viz.NEGATIVE_X
viz.POSITIVE_Y
viz.NEGATIVE_Y
viz.POSITIVE_Z
viz.NEGATIVE_Z

With 3D textures it specifies which depth slot to load the image into.

In both cases, the file must contain the same width, height, and pixel format as the original texture.


Remarks

Use this to change the image of the texture. If you load a new image onto the texture, then all objects that had this texture applied to will change also.

Return Value

True/False

Example

tex = viz.addTexture('tree.jpg')
quad = viz.addTexQuad()
quad.texture(tex) # The quad will now display the tree picture
tex.load('flower.jpg') # The quad will now display the flower picture

See also

<multimedia:image>.loadBuffer
<multimedia:image>.setImageData