jprochazk / ldtk-ts

Parser for the LDtk project file format.
https://www.jan-prochazka.eu/ldtk-ts
MIT License
9 stars 3 forks source link

cannot access all world data due to private data field #3

Open paperdave opened 2 years ago

paperdave commented 2 years ago

i understand that .data is supposed to be private, but not all properties are accessible this way. here is one line from my level loading code where i use an any type.

// entity's defined width
i.width = (entity as any).data.width * 4;

i love this library and i'd be fine contributing some extra functions to it, if that would be ok.

jprochazk commented 2 years ago

Entity width was added in ldtk version 0.8.0, but the latest version this library supports is 0.7.2. I don't use ldtk anymore and had no idea that people were using this library. I took a quick look at the changes in https://ldtk.io/json/, and it doesn't seem like it would be too much effort to update everything. Nothing was removed, and a couple of things were added.

I'm definitely open to contributions! I'll probably get around to it by the end of the week, but if you'd like to give it a try, it would require:

paperdave commented 2 years ago

no idea that people were using this library. i'm probably one of the only ones lol

and i didn't realize the thing about versions. I'll go ahead and see if i can get that done myself. like i know the width getter is literally just getting the .data.width property.

thanks for the quick response