Comments (7)
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.
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.
@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.
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.
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.
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.
Fixed by #9.
from godot-tiled-importer.
Related Issues (20)
- Add support for tiles normal maps HOT 2
- godot 4 (alpha) support? HOT 5
- Wiki Documentation for Tile Names, Animations, Custom Materials, and Z index features
- Save Tiled Properties for single tile not working HOT 1
- Invalid get index 'name' when importing tileset with save_tiled_properties enabled
- Invalid get index 'properties' (on base: 'Dictionary'). when importing tmx file with save_tiled_properties enabled HOT 1
- warning appears when importing the tmx file "core/image.cpp:2051 - Loaded resource as image file, this will not work on export:"
- can you submit one example where you use Area2d the tiled map and the godot project. on godot 3.4 because old version do not work whit new android rulers
- Tiled Editor has updated and Type is now called Class HOT 5
- Default properties are not imported and show `Null` HOT 2
- "Child" class attributes not mapped in Godot as metadata
- Setup unit tests
- Object collisions are no longer positioned correctly in the Y in Godot 3.5.
- Objects are positioned incorrectly after import HOT 2
- New Class property (vs older Type property) : Area generates StaticBody2D instead of Area2d
- Maps cannot be imported at runtime?
- Import objects as tscns? HOT 4
- Feature request: Importing labels
- TMX import crash with 3.6
- Animated Tiles and Godot 4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-tiled-importer.