GithubHelp home page GithubHelp logo

Comments (7)

SleepProgger avatar SleepProgger commented on May 14, 2024

The linked branch is working but i didn't send a PR yet as i am not sure how to handle some things.

ATM: i am creating a directory with the name of the tileset containing the images named like ID.png.
Should we clear the directory if it exists before or warn the user that he is overwriting existent data ?

How to handle malformed tile->image nodes (No width, height or source attributes) ?
IMHO we should err out and tell the user the file is corrupt. Granted we could "fix" missing width and height by using tileheight and tilewidth, but no chance to fix a missing source.

Your thoughts ?

from godot-tiled-importer.

vnen avatar vnen commented on May 14, 2024

I don't like asking for overwrites. Godot has auto-reimport, so it'll overwrite all the time when you save the map in Tiled, in which case the user wouldn't need to be bothered about it. Probably something to state in the manual and maybe in the import dialog.

At first I don't like the idea of creating an extra dir. This can be added as a new option though, as some people might prefer to use like this. Also, the image has an original name in the source, so it can keep the name when copied over.

About missing info, it depends. If Tiled always save those in the file, then you can send an error if they're missing. Otherwise, send and error only if it's irrecoverable.

Overall I like your patch. Only thing I'd add is the boolean option to save images in an extra dir with the tileset name (maybe it can even be default on). I can add that later if you're not used to that part of code though.

from godot-tiled-importer.

vnen avatar vnen commented on May 14, 2024

@SleepProgger BTW, sorry for the delay in my responses. I'm kind busy lately and it seems we live in disparate time zones.

from godot-tiled-importer.

SleepProgger avatar SleepProgger commented on May 14, 2024

No worries about the response time, my sleep schedule is all kind of messed up anyway ;)

Your suggestion is saving the images directly in the tileset dir with its original name (if the user didn't choose to save them in an extra directory) ?
I used the extra directory to ensure that no image accidentally overwrites others.
What about naming them like TILESETNAME_ORIGINAL_NAME.png ?
That should do the trick ?

I am going to read the tiled docs about which attributes are required and add the error handling.
This means to throw the error up two more levels (in _parse_tileset and _tmx_to_dict), but i guess thats ok.

About the boolean flag: That sounds like a good idea. Will implement.

/me getting coffee and go to work

from godot-tiled-importer.

vnen avatar vnen commented on May 14, 2024

Your suggestion is saving the images directly in the tileset dir with its original name (if the user didn't choose to save them in an extra directory) ?

Yes, even in the extra directory they can keep the original name. Adding the TileSet name as prefix is good too.

from godot-tiled-importer.

SleepProgger avatar SleepProgger commented on May 14, 2024

According to http://doc.mapeditor.org/reference/tmx-map-format/#tileset images can be embedded if the image node has a format attribute.
ATM. this case isn't handled by the plugin, but i don't think it should by anyway.
But there should be a check if the image element has a source attribute.
I could add it for both cases (tileset image and tile image) while i am at it.

I guess implementing loading embeded images from tmx files wouldn't be that hard to implement, but i don't really see the benefit tbh.

from godot-tiled-importer.

vnen avatar vnen commented on May 14, 2024

Fixed by #9.

from godot-tiled-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.