Thank you for your response. I'm using cocos2d 0.6.4 and pyglet 1.2.4 with Python version 3.5.2 32 bit.
Going into specifics about the resources, untitled.png is a 1342 by 580
pixels blank (completely white) image created in microsoft paint;
untitled.tmx is a 10 by 10 map created using Tiled (the program from
mapeditor.org, a website mentioned on the Cocos Python tutorial) with the
tileset tmw_desert_spacing.png, which comes with Tiled as a sample tileset.
I've attached helloworld.py, tmw_desert_spacing.png, Untitled.png, and
untitled.tmx to this post.
On a related note, so long as untitled.tmx doesn't have a tileset
associated with it, I won't encounter an issue with cocos.tiles.load_tmx
after instantiating cocos.sprite.Sprite (whether or not it's bound to a
reference).
While I'm no expert on disagreement between resources, what you think might
be happening sounds about right. However, it doesn't appear to be an issue
specifically between Untitled.png and untitled.tmx; the code I provided was
my attempt to replicate with as little code as possible an issue I
encountered while dealing with sprites created from images other than
Untitled.png and a map other than untitled.tmx. While untitled.tmx does use
the same tileset, I encountered the same issue using buch-outdoor.png,
another tileset that comes with Tiled.exe as a sample tileset. After
reading your reply, I created a .jpg and .gif version of Untitled.png and
tried running code that created a sprite from those, but still encountered
the error.
I also attempted running the code with different versions of Python. I
received the following exception with Python 2.7.12 32bit:
Traceback (most recent call last):
> File "C:/Users/Lucas/PycharmProjects/HelloWorld/Test/helloworld.py",
> line 6, in <module>
> cocos.tiles.load_tmx("untitled.tmx")
> File "C:\Program Files
> (x86)\Python\Python27\lib\site-packages\cocos\tiles.py", line 327, in
> load_tmx
> column_padding=spacing)
> File "C:\Program Files
> (x86)\Python\Python27\lib\site-packages\cocos\tiles.py", line 634, in
> from_atlas
> gl.glBindTexture(tile_image.texture.target, id)
> File "C:\Program Files
> (x86)\Python\Python27\lib\site-packages\pyglet\gl\lib.py", line 104, in
> errcheck
> raise GLException(msg)
> pyglet.gl.lib.GLException: invalid operation
>
I received the following exception with Python 2.7.12 64bit:
Traceback (most recent call last):
> File "C:/Users/Lucas/PycharmProjects/HelloWorld/Test/helloworld.py",
> line 6, in <module>
> cocos.tiles.load_tmx("untitled.tmx")
> File "C:\Program
> Files\Python\Python27\lib\site-packages\cocos2d-0.6.4-py2.7.egg\cocos\tiles.py",
>
> line 327, in load_tmx
> column_padding=spacing)
> File "C:\Program
> Files\Python\Python27\lib\site-packages\cocos2d-0.6.4-py2.7.egg\cocos\tiles.py",
>
> line 634, in from_atlas
> gl.glBindTexture(tile_image.texture.target, id)
> File "_build\bdist.win-amd64\egg\pyglet\gl\lib.py", line 104, in errcheck
> pyglet.gl.lib.GLException: invalid operation
--
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.
import cocos
cocos.director.director.init()
cocos.sprite.Sprite("Untitled.png")
cocos.tiles.load_tmx("untitled.tmx")
untitled.tmx
Description: Binary data
