Skip to content

TypeError when loading tiled map with an image layer #1832

@vanicat

Description

@vanicat

Bug Report

on the current development branch, I've an error when loading a tiled-map containing an image layer : TypeError: BasicSprite.init() got multiple values for argument 'texture'. Backtrace at the end on this message.

System Info

Arcade 3.0.0.dev25

vendor: NVIDIA Corporation
renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
version: (3, 3)
python: 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]
platform: win32
pyglet version: 2.0.8
PIL version: 9.5.0

Steps to reproduce/example code:

the code:

  arcade.load_tilemap("image_layer.json")

image_layer.json containing only one image layer (for example https://pastebin.com/W5PmVR9v)

Backtrace

/Users/remiv/Documents/Python-Scripts/arcade/minimal.py
Traceback (most recent call last):
File "c:\Users\remiv\Documents\Python-Scripts\arcade\minimal.py", line 3, in
tile_map = arcade.load_tilemap("image_layer.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\remiv\Documents\Python-Scripts\arcade\arcade\tilemap\tilemap.py", line 1038, in load_tilemap
return TileMap(
^^^^^^^^
File "c:\Users\remiv\Documents\Python-Scripts\arcade\arcade\tilemap\tilemap.py", line 265, in init
self._process_layer(layer, global_options, layer_options)
File "c:\Users\remiv\Documents\Python-Scripts\arcade\arcade\tilemap\tilemap.py", line 301, in _process_layer
processed = self._process_image_layer(layer, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\remiv\Documents\Python-Scripts\arcade\arcade\tilemap\tilemap.py", line 707, in _process_image_layer
my_sprite = custom_class(**custom_class_args, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\remiv\Documents\Python-Scripts\arcade\arcade\sprite\sprite.py", line 83, in init
super().init(
TypeError: BasicSprite.init() got multiple values for argument 'texture'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions