I solved  it, chaging the tmx for another one more tiny.

El dia divendres, 22 de gener de 2021 a les 21:05:55 UTC+1, Claudio Canepa 
va escriure:

> The last line in the traceback,
> layer.set_view(childs_scroll_x, childs_scroll_y, w, h, AttributeError: 
> 'TileSet' object has no attribute 'set_view' 
> implies bg was read as a Tileset object, when it should be a RectMapLayer 
> or HexMapLayer.
>
> bg comes from
> bg = load_tmx("maps/space_map_2.tmx")["space"]
>
> Maybe "space" is not the correct selector?
>
> Other than that, I will need to look at the tmx to tell more.
>
>
> On Fri, Jan 22, 2021 at 8:26 AM Toni Roca <[email protected]> wrote:
>
>> Its crashes when:
>>
>> characted_layer.add(bg)
>>
>> El dia divendres, 22 de gener de 2021 a les 10:12:19 UTC+1, Toni Roca va 
>> escriure:
>>
>>> https://pastebin.com/fhnsHjWR
>>>
>>> https://pastebin.com/6fEqrNXY
>>>
>>> El dia dijous, 21 de gener de 2021 a les 23:06:43 UTC+1, Claudio Canepa 
>>> va escriure:
>>>
>>>> could you paste the code and traceback on some pastebin, by example 
>>>> https://pastebin.com ?
>>>>
>>>> On Thu, Jan 21, 2021 at 6:59 PM Antoni Rocafort <[email protected]> 
>>>> wrote:
>>>>
>>>>>
>>>>> Hello I'm developing a game with cocos2d in python. I am trying load a 
>>>>> tiled map, but i have problems with it.
>>>>>
>>>>> 1-Large time of loading a tmx file.
>>>>>
>>>>> 2-Atribute error while loading the tiled map.
>>>>>
>>>>> My code:
>>>>> class Level(Scene): 
>>>>> def __init__(self): 
>>>>> super().__init__()
>>>>> cha = Character() 
>>>>> bg = load_tmx("maps/space_map_2.tmx")["space"] 
>>>>> character_layer = ScrollingManager()
>>>>> character_layer.add(bg) character_layer.add(cha) 
>>>>> self.add(character_layer) 
>>>>>
>>>>> How can i reduce the loading time?
>>>>> Traceback (most recent call last): File 
>>>>> "***/PycharmProjects/smashking/Main.py", line 74, in <module> 
>>>>> escena_2 = Level() File "***/PycharmProjects/smashking/Levels.py", 
>>>>> line 13, in __init__ character_layer.add(bg) File 
>>>>> "***/PycharmProjects/course/venv/lib/python3.8/site-packages/cocos/layer/scrolling.py",
>>>>>  
>>>>> line 295, in add self.set_focus(self.fx, self.fy, force=True) File 
>>>>> "***/PycharmProjects/course/venv/lib/python3.8/site-packages/cocos/layer/scrolling.py",
>>>>>  
>>>>> line 373, in set_focus return self.force_focus(fx, fy) File 
>>>>> "***/PycharmProjects/course/venv/lib/python3.8/site-packages/cocos/layer/scrolling.py",
>>>>>  
>>>>> line 481, in force_focus layer.set_view(childs_scroll_x, 
>>>>> childs_scroll_y, w, h, AttributeError: 'TileSet' object has no 
>>>>> attribute 'set_view' 
>>>>>
>>>>> Why is getting this error while loading?
>>>>>
>>>>> -- 
>>>>> 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 view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/cocos-discuss/c222af1f-abb9-49df-8413-7d553b6ba813n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/cocos-discuss/c222af1f-abb9-49df-8413-7d553b6ba813n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/cocos-discuss/63c63cdd-286d-4159-8be4-1be8613446fcn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/cocos-discuss/63c63cdd-286d-4159-8be4-1be8613446fcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/cocos-discuss/d7c46b16-ded1-4ccc-ba6e-9c28e1c10d58n%40googlegroups.com.

Reply via email to