diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-07-29 05:24:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-07-29 05:24:03 +0400 |
commit | 26589497529ca3c8da85391d4976d286a371e258 (patch) | |
tree | e1549256e9f68706375b64d656ece51e4e1bf152 /doc/python_api/examples/bge.texture.1.py | |
parent | 336a47cdcf909864e080d9917cbc04bd7134da1f (diff) |
pep8 cleanup, also print message when attempting to run in animation player mode.
Diffstat (limited to 'doc/python_api/examples/bge.texture.1.py')
-rw-r--r-- | doc/python_api/examples/bge.texture.1.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/doc/python_api/examples/bge.texture.1.py b/doc/python_api/examples/bge.texture.1.py index 74b37e72994..faa0ae736e8 100644 --- a/doc/python_api/examples/bge.texture.1.py +++ b/doc/python_api/examples/bge.texture.1.py @@ -6,29 +6,31 @@ createTexture() and removeTexture() are to be called from a module Python Controller. """ from bge import logic -from bge import texture +from bge import texture + def createTexture(cont): """Create a new Dynamic Texture""" object = cont.owner - + # get the reference pointer (ID) of the internal texture ID = texture.materialID(obj, 'IMoriginal.png') - - # create a texture object + + # create a texture object object_texture = texture.Texture(object, ID) - + # create a new source with an external image url = logic.expandPath("//newtexture.jpg") new_source = texture.ImageFFmpeg(url) - + # the texture has to be stored in a permanent Python object logic.texture = object_texture - + # update/replace the texture logic.texture.source = new_source logic.texture.refresh(False) + def removeTexture(cont): """Delete the Dynamic Texture, reversing back the final to its original state.""" try: |