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

Read ObjectLayer Objects .type property for Tiles #1609

Merged
merged 2 commits into from
Feb 10, 2015

Conversation

mikaturunen
Copy link
Contributor

Why isn't the .type already read from the objects details for Tile objects as it's there? Latest release version of Tiled 0.11.0 has this field for ObjectLayers Tile Objects and it's quite extensively used by other frameworks.

Well, I need this and I suppose there are other people too who might be interested in having this in here too. Currently I go around this by creating a custom property of "type" and setting my value on it but that's just extremely silly. :)

Why isn't the .type already read from the objects details as it's there? Latest release version of Tiled 0.11.0 has this field for Objects and it's quite extensively used by other frameworks.

Well, I need this and I suppose there are other people too who might be interested in having this in here too. Currently I go around this by creating a custom property of "type" and setting my value on it but that's just extremely silly.
@photonstorm
Copy link
Collaborator

Because it doesn't exist prior to 0.11 - I don't mind merging this PR but please change it to only set the type property if it exists, or provide a fallback value if it doesn't.

@mikaturunen
Copy link
Contributor Author

Ah, due to historic reasons. That explains it. Thanks mate! Will do.

As implementation is leaning on 0.11.0 feature of Tiled, I made sure the earlier Tiled files that might be used are not going to break from this. Defaulting to empty string if the .type property is not defined by Tiled (for Tiled < 0.11.0), otherwise we use the provided value.
@mikaturunen
Copy link
Contributor Author

That should do it. Defaults to empty string in case of the .type property is missing from the Object.

@photonstorm
Copy link
Collaborator

Perfect, thanks.

photonstorm added a commit that referenced this pull request Feb 10, 2015
Read ObjectLayer Objects .type property for Tiles
@photonstorm photonstorm merged commit 9603838 into phaserjs:dev Feb 10, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants