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

[GMX-Exporter] Add 1000000 to layer depth of tiles #1814

Closed
TrunXGIT opened this issue Nov 9, 2017 · 4 comments
Closed

[GMX-Exporter] Add 1000000 to layer depth of tiles #1814

TrunXGIT opened this issue Nov 9, 2017 · 4 comments

Comments

@TrunXGIT
Copy link
Contributor

TrunXGIT commented Nov 9, 2017

In GameMaker 0 is the standard depth value for new objects.
The standard depth value for a new tile layer is 1000000.

So it's quite common to use values between -1000 to 1000 to order your objects.
Values around 1000000 for background elements and huge negative numbers for foreground elements.

Tiled exports it's tile layers at the depth of 1, 2, 3... so basically the same depth values the objects in a GM-Project are usually using.

Simple solution: Add 1000000 to the depth on export.

@bjorn
Copy link
Member

bjorn commented Nov 9, 2017

Interesting suggestion. It sounds like it would indeed be good to start counting at 1000000 then.

Note that in the meantime you can set a custom integer property called depth on your layers, and Tiled will then export those layers with that depth instead of using the layer index. Seems like I missed this property in the documentation. The property already existed since Tiled 0.18.

@bjorn bjorn closed this as completed in 6a642c2 Nov 22, 2017
@bjorn
Copy link
Member

bjorn commented Nov 22, 2017

This has now been implemented and will be included in the next development snapshot.

In GameMaker 0 is the standard depth value for new objects.

While I could see the depth in GameMaker for tiles indeed defaults to 1000000, I did not see any depth setting for objects. Also I don't see a "depth" attribute for instances in the room XML file. What are you referring to here?

@TrunXGIT
Copy link
Contributor Author

You can find the input field for "Depth" inside the object properties on the left side. Instances inherit the depth value from the object. You can overwrite it by changing the "depth" variable in the creation code.

@bjorn
Copy link
Member

bjorn commented Nov 25, 2017

You can find the input field for "Depth" inside the object properties on the left side. Instances inherit the depth value from the object. You can overwrite it by changing the "depth" variable in the creation code.

Ah, that explains why I couldn't find it. I was looking for it while placing instances, not while editing objects. Speaking of creation code, I should make sure to get around to #1768 soon.

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

2 participants