If I invoke the function cocos.tiles.load_tmx after instantiating
cocos.sprite.Sprite and adding it to another CocosNode or assigning it to a
reference, I receive the following exception: pyglet.gl.lib.GLException:
b'invalid operation'. I'm unsure if this behavior is intended or not.
If I run the following code...
import cocos
cocos.director.director.init()
sprite = cocos.sprite.Sprite("Untitled.png")
cocos.tiles.load_tmx("untitled.tmx")
...I receive the following exception and stack trace:
C:\Test>python helloworld.py
> Traceback (most recent call last):
> File "helloworld.py", line 5, in <module>
> cocos.tiles.load_tmx("untitled.tmx")
> File "C:\Program Files
> (x86)\Python\Python35-32\lib\site-packages\cocos\tiles.py", line 327, in
> load_tmx
> column_padding=spacing)
> File "C:\Program Files
> (x86)\Python\Python35-32\lib\site-packages\cocos\tiles.py", line 634, in
> from_atlas
> gl.glBindTexture(tile_image.texture.target, id)
> File "C:\Program Files
> (x86)\Python\Python35-32\lib\site-packages\pyglet\gl\lib.py", line 104, in
> errcheck
> raise GLException(msg)
> pyglet.gl.lib.GLException: b'invalid operation'
>
Interestingly, if I don't bind the cocos.sprite.Sprite instance to a
reference or add it to another node, the code executes without issue.
Again, I'm unsure if this is intended behavior or I'm doing something wrong
or what, but, if possible, could someone explain to me why this is
happening and possibly how I can use cocos.tiles.load_tmx with instances of
cocos.sprite.Sprite floating around?
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.