-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Defold export Z value from layer order #3214
Comments
Ideally this is what we could implement. We just need to know what are sane defaults, as well as what happens to those defaults if one or more of the layers is manually assigned a Z value. It could either have no effect at all, or the ones that are left undefined somehow automatically sit between the others. The latter is what is implemented for the GameMaker export: tiled/src/plugins/yy/yyplugin.cpp Lines 1253 to 1294 in b1450db
Since I don't have much experience with Defold, hopefully you can help determine what would be a good approach to assigning defaults. :-) |
Good question! :) The War Battles Tutorial tutorial for Defold mentions setting your character to Would it be counter-intuitive to start in the negative range counting up toward 0? If the user can set a custom depth value on their lowest layer then we count up to determine the next value as in the implementation of the GameMaker exporter, it doesn't immediately seem like a bad idea. Some ideas: Open to additional lines of thinking here though, not 100% confident in my suggestion. |
Just a note, I noticed the "defoldcollection" plugin does already set some Z value by default. Maybe you could just switch to that plugin? Or is there a reason you need (or needed) to export only a .tilemap asset? |
I will check out the plugin and see if it works for my needs. TBH, I forgot why I was exporting the .tilemap asset directly, and need to revisit the project. Thanks for the heads up! |
Ok, I've just added a simple assigning of incrementing z values to the Defold plugin, plus a way to override it with a custom property. I've also extended both the Defold and the Defold Collection plugin with a way to set the |
Amazing! Thanks for all your hard work! |
Hello, @bjorn ! As said in docs:
But this code only in defold plugin, not defoldcollection. On --export-map it uses |
This change didn't affect
Which plugin is used on |
@bjorn Oh, thanks for your explanation! Yea it little bit more clearly now. Yeah, i'm expected I'm able to override z value of top layer layers in defoldcollection like it's done in defold plugin. Do I need make another issue for that? |
No, I've just added the ability to override the automatically determined z value per-layer (using a custom "z" property). But I didn't test it yet, so it would be great if you could give the resulting builds a try: https://github.com/mapeditor/tiled/actions/runs/3108223130. I'll still need to adjust the documentation before pushing to |
@bjorn thanks, it works now! ❤️ It's work for tileset layers. But I need correct myself - in Defold for tilesets Z property is available only in [-1..1] |
@Insality I've pushed that change to |
After exporting to a defold tilemap the user must open the tilemap in defold and assign z values to each layer to have it match the order that was defined in the Tiled project to ensure the tilemap renders correctly.
The z value that a user would use here is somewhat specific to their project but generally Defold defaults to -1 to 1 for z range with -1 being far and 1 being near.
What would be the best approach to allow for the user to export directly from Tiled without the need to reset the z values of each layer on each export?
Considerations that come to mind are:
Would CustomProperties be a good solution here to override a z value and just have each layer default to some sane export z value based on it's order ad listed in the project layers?
The text was updated successfully, but these errors were encountered: