Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist Per-Tile Custom Data to Tiled Export #988

Open
TomMalitz opened this issue Oct 26, 2023 · 0 comments
Open

Persist Per-Tile Custom Data to Tiled Export #988

TomMalitz opened this issue Oct 26, 2023 · 0 comments

Comments

@TomMalitz
Copy link
Contributor

TomMalitz commented Oct 26, 2023

Like many others, I love LDtk but many engines and tools support mature features for Tiled.

The Tiled export works well, but currently the per-tile custom data that is set in LDtk does not persist in the Tiled export. It would be nice to be able to persist a flat JSON object from the LDtk custom data to the custom properties in the tmx tileset data.

As an example, let's assume we have a tileset and for tile 0 we have the following custom data in LDtk:

{
 "bool": true,
 "string": "text",
 "int": 1,
 "float": 10.5
}

Currently in the tmx export this tileset will look like following, losing all custom data:

<tileset firstgid="1" name="TileSet" tilewidth="16" tileheight="16" tilecount="16" columns="4" objectalignment="topleft" margin="0" spacing="0">
  <image source="../path/tileset.png" width="64" height="64"/>
</tileset>

With the proposed change the tmx export tileset would reflect the the following, retaining the custom data from LDtk:

<tileset firstgid="1" name="TileSet" tilewidth="16" tileheight="16" tilecount="16" columns="4" objectalignment="topleft" margin="0" spacing="0">
  <image source="../path/tileset.png" width="64" height="64"/>
  <tile id="0">
   <properties>
    <property name="bool" type="bool" value="true"/>
    <property name="string" value="text"/>
    <property name="int" type="int" value="1"/>
    <property name="float" type="float" value="10.5"/>
   </properties>
  </tile>
</tileset>

Tiled custom properties support additional types, but I think having bool, string, int, and float would cover the majority of use-cases for using custom properties in the Tiled export data.

Let me know what you think, and again, love LDtk!

-- Update --

Actually ended up implementing this and opened a PR - #989

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant