I think you cannot load the entire map in like that, you can only add a 
layer at a time. So just set the map to a variable and reference it for 
each layer to add.

map = cocos.tiles.load("mymap.tmx")

layer1 = map['layer1']

layer2 = map['layer2']

scrollable.add(layer1)

scrollable.add(layer2)




On Monday, July 13, 2015 at 7:46:55 PM UTC-4, Barack Frowbama wrote:
>
> I am currently following the documentation at 
> http://python.cocos2d.org/doc/programming_guide/tiled_map.html#controlling-map-scrolling
> 1 
> <http://www.google.com/url?q=http%3A%2F%2Fpython.cocos2d.org%2Fdoc%2Fprogramming_guide%2Ftiled_map.html%23controlling-map-scrolling&sa=D&sntz=1&usg=AFQjCNHy3Xnsjw9W2PsrAZ9Us4xI6EJbhw>
>  
> to load a Tiled (.tmx) orthogonal map into my game.
>
>
> Now I am loading my .tmx map into the game via the following Python code:
>
> map = cocos.tiles.load("mymap.tmx")
>
> However, this line of code raises the following error: 
>
> 'Resource' object has no attribute 'set_view'
>
> Now the weird thing is that the following line of code bypasses that 
> issue, but the drawback is that it only loads one layer on my Tiled (.tmx) 
> map.
>
> map = cocos.tiles.load("mymap.tmx")['layer1']
>
> I can't seem to figure out why this error is being raised, but I am hoping 
> someone with a good understanding of cocos can aid me.
>
>
> Thanks a ton!
>

-- 
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.

Reply via email to