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

Polygon colliders load as Rect shapes #223

Closed
Aposhian opened this issue Jun 5, 2022 · 5 comments
Closed

Polygon colliders load as Rect shapes #223

Aposhian opened this issue Jun 5, 2022 · 5 comments

Comments

@Aposhian
Copy link
Contributor

Aposhian commented Jun 5, 2022

When I have a tileset with Polygon colliders, they are still loading as Rect shapes. Example tileset at https://github.com/Aposhian/bevy-sandbox/blob/tilemap-refactor/assets/grass_walls.tsx

@Aposhian
Copy link
Contributor Author

Aposhian commented Jun 5, 2022

I think the issue is that the object templates are not being loaded properly, and so it silently defaults to dummy Rect objects. I would advocate that that be not a silent failure to a different shape type.

@aleokdev
Copy link
Contributor

aleokdev commented Jun 5, 2022

On which version is this? (current / 0.10.2 does not have template support.)

@Aposhian
Copy link
Contributor Author

Aposhian commented Jun 5, 2022

This was on 0.10.2 (without template support). I still don't like the silent failure, but maybe the point is moot with template support being added in the next version.

@aleokdev
Copy link
Contributor

aleokdev commented Jun 5, 2022

It's not really a "feature", but rather done for compatibility with the TMX format. <object> doesn't need to contain a shape and so it defaults to a rectangle: https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#object

I do agree that with the template attribute set this makes things a bit confusing, and perhaps we should've chosen to throw an error (or log a warning?) if the template parameter was set as there was no support for it. Changing this now to return an error could break loading for some users though, so I think it's better we just wait until the 0.11 release.

@bjorn
Copy link
Member

bjorn commented Jun 6, 2022

I still don't like the silent failure, but maybe the point is moot with template support being added in the next version.

Yeah, I think at this point it's not really worth it making a new release that errors out on templates. 0.11 should be almost done (it's mainly still depending on the final solution for #37 - ggez integrates nicely now, but @aleokdev was still looking into integrating with Bevy).

@bjorn bjorn closed this as completed Jun 6, 2022
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

3 participants