mapeditor/tiled



Do you want to work on this issue?
You can request for a bounty in order to promote it!
Scripting: layer instanceof TileLayer produces a type error #3232
yanchith posted onGitHub
Hey :)
Thanks for making Tiled ❤️
When implementing an exporter to a custom level format from Tiled's TileMap
, I managed to produce a type error (TypeError: Type error
) from the script when doing:
const isTileLayer = layer instanceof TileLayer; // For the record, layer really was a TileLayer
In the d.ts
, TileLayer
is defined as:
declare class TileLayer extends Layer
.. but I imagine this is probably not a JS class, but Tiled's data structure that is just accessible from JS, but it likely doesn't implement all the operators.
I know, there's Layer.isTileLayer
, but this probably shouldn't crash.
Also, I checked other layer types (GroupLayer
, ImageLayer
and ObjectGroup
), and they behave the same. Not sure about other API types.
Platform: Windows Tiled Version: 1.7.2