Hi, I'm using a tile editor called cocograph which creates a map and
produces the xml file. I made a map, of size 640 X 480 pixels and
loaded it using this:
import cocos
from cocos.director import *
from cocos import tiles
r = tiles.load('hell.xml')
scene = cocos.scene.Scene(r['level1'])
director.init()
director.run(scene)
However, it gave me the following error:
Traceback (most recent call last):
File "m.py", line 7, in <module>
r = tiles.load('hell.xml')
File "/home/karan/just/src/cocos/tiles.py", line 315, in load
obj = Resource(filename, paths)
File "/home/karan/just/src/cocos/tiles.py", line 200, in __init__
self.handle(root)
File "/home/karan/just/src/cocos/tiles.py", line 236, in handle
return self.factories[tag.tag](self, tag)
File "/home/karan/just/src/cocos/tiles.py", line 215, in
resource_factory
self.handle(child)
File "/home/karan/just/src/cocos/tiles.py", line 236, in handle
return self.factories[tag.tag](self, tag)
File "/home/karan/just/src/cocos/tiles.py", line 498, in
rectmap_factory
m = RectMapLayer(id, width, height, cells, origin)
File "/home/karan/just/src/cocos/tiles.py", line 673, in __init__
super(RectMapLayer, self).__init__()
File "/home/karan/just/src/cocos/tiles.py", line 586, in __init__
super(MapLayer, self).__init__()
File "/home/karan/just/src/cocos/tiles.py", line 547, in __init__
super(ScrollableLayer,self).__init__()
File "/home/karan/just/src/cocos/layer/base_layers.py", line 59, in
__init__
super( Layer, self ).__init__()
File "/home/karan/just/src/cocos/cocosnode.py", line 111, in
__init__
self.camera = Camera()
File "/home/karan/just/src/cocos/camera.py", line 55, in __init__
self.restore()
File "/home/karan/just/src/cocos/camera.py", line 75, in restore
width, height = director.get_window_size()
File "/home/karan/just/src/cocos/director.py", line 383, in
get_window_size
return ( self._window_original_width,
self._window_original_height)
AttributeError: 'Director' object has no attribute
'_window_original_width'
What could be causing the problem ? Is it necessary to create a
RectMapLayer class?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cocos-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---