typo:
for name in level_map.contents:
print(name, level_map_contents)
should be
for name in level_map.contents:
print(name, level_map.contents[name])
sorry
On Mon, Jul 13, 2015 at 9:58 PM, claudio canepa <[email protected]> wrote:
> Hi,
>
> On Mon, Jul 13, 2015 at 7:28 PM, Barack Brobama <[email protected]>
> wrote:
>
>> I'm having an issue with cocos2d-python importing my .tmx orthogonal
>> Tiled map.
>>
>> I can successfully load ONE of the visible layers by doing something
>> like, i.e.:
>>
>> map = cocos.tiles.load("map.tmx")['layer1']
>>
>
>
> The line above is the same as
>
> the_full_map = cocos.tiles.load("map.tmx")
> map = the_full_map['layer1']
>
> And you say it worked well, yet
>
>
>
>> But the error *'Resource' object has no attribute 'set_view'* is raised
>> when I do this:
>>
>> map = cocos.tiles.load("map.tmx")
>>
>>
>>
> explodes.
>
> It is the same line as above, which reads and parses the file "map.tmx",
> so something is missing in your description.
>
> Maybe you got confused by the poor naming in test/test_tmx.py ?
> To load two layers from a map you can write
>
> # parses all of the file "map.tmx", building an instance of
> cocos.tiles.Resources which
> # contains all entities described in the file
> level_map = cocos.tiles.load("map.tmx")
>
> # to see what are the top entities in the map
>
> for name in level_map.contents:
> print(name, level_map_contents)
>
> # usually that will print layers, tilesets and tmx object layers; suppose
> # they are two layers "lava_layer" and "cracked_rock_layer"
>
> # methods defined in the Resource class ensures
> # level_map.contents[name] == level_map[name] for every name
> # so to make a reference to the the layer named 'lava_layer'
>
> deep_layer = level_map["lava_layer"]
>
> # and similar with the other layer
>
> surface_layer = level_map["cracked_rock_layer"]
>
> Does this help ?
>
> Maybe I misunderstand you
>
>
>> I'm on Windows 7: Python 2.7.5 and using cocos2d-python version 0.6.3.
>>
>
>
>
>
--
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 http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.