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

implement loading Tiled Point objects #6384

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

happy-bracket
Copy link

This pull request adds Tiled Point objects (https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#point).

As of now, TmxMapLoader parses points into rectangles with zero width/height. This behavior is probably fine as it is, but one could argue that it's counter-intuitive and non-explicit, so, here we are.

It's also a breaking change for all the people who rely on that their points are parsed into zero-sized rectangles. So, if this PR has any value, I'm open to suggestions on how to work around that.

TiledMapObjectLoadingTest is updated to reflect a new type of objects.

@happy-bracket happy-bracket changed the title implement loading points as in https://doc.mapeditor.org/en/stable/re… implement loading Tiled Point objects Jan 30, 2021
@SimonIT
Copy link
Member

SimonIT commented Jan 30, 2021

You have to add the PointMapObject to this file for gwt:

<!-- maps/objects -->
<include name="maps/objects/CircleMapObject.java"/>
<include name="maps/objects/EllipseMapObject.java"/>
<include name="maps/objects/PolygonMapObject.java"/>
<include name="maps/objects/PolylineMapObject.java"/>
<include name="maps/objects/RectangleMapObject.java"/>
<include name="maps/objects/TextureMapObject.java"/>

@happy-bracket
Copy link
Author

@SimonIT fixed, thank you

@SimonIT SimonIT requested a review from mgsx-dev February 6, 2021 18:30
Copy link
Contributor

@mgsx-dev mgsx-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix formatting, indentation seams off. You can use provided formatter, see contribution guidelines.
You also need to update CHANGES file with this API addition.

Apart from these details, it looks good to me.

@mgsx-dev mgsx-dev added breaking change Label for breaking changes tilemap labels Feb 12, 2021
@@ -300,6 +300,7 @@
<include name="maps/objects/PolylineMapObject.java"/>
<include name="maps/objects/RectangleMapObject.java"/>
<include name="maps/objects/TextureMapObject.java"/>
<include name="maps/objects/PointMapObject.java"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please fix formatting here as well :-)

@mgsx-dev
Copy link
Contributor

I think it's good to have it but considering it's a breaking change without much value for now, i propose to merge it when we will implement some other big changes related to Tiled 1.x (eg. infinite map support, template support) and/or a new major version of libGDX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Label for breaking changes tilemap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants