-
Notifications
You must be signed in to change notification settings - Fork 20
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
margin seems to be ignored #443
Comments
@max-vogler Thanks for the issue! Definitely unexpected Is this the margin you're setting in Tiled? |
Yes, exactly! Excuse the short bug report without code/reproduction. My problem was solved after re-doing the tileset without margin and I don't see margin being used in the plugin code. |
Hopefully a quick fix 🤞 I distinctly remember writing this type of thing for spritesheets in the main repo |
@max-vogler Think I've got this figured! Excalibur uses the same words as Tiled for different things haha! Also we were note interpreting Tiled's concept of margin into Excalibur. |
Closes #443 TODO: * [x] Tests Tiled and Excalibur use the same words for different things 🤦 * Tiled tileset `margin` is the same as Excalibur's `SpriteSheet.originOffset` * Tiled tileset `spacing` is the same as Excalibur's `SpriteSheet.margin` Uploaded a Tiled example that demonstrates this in the plugin <img width="320" alt="image" src="https://github.com/excaliburjs/excalibur-tiled/assets/612071/60844efe-929a-438a-9ea5-01540130d99c"> <img width="414" alt="image" src="https://github.com/excaliburjs/excalibur-tiled/assets/612071/f3daa2e1-fd2d-487e-b2bb-2146c5002933">
Hey thank you so much for the quick fix, love the fast turnaround time! I left a short comment in 0fe3031#r120139294, because I think there might still be a bug related to applying Tiled margin on the right and bottom side, which is not captured by Excalibur's originOffset. |
Steps to Reproduce
Import a Tiled map using a Tiled tileset loading a single image with a margin (e.g. 8 pixels of blank space around the tiles, don't confuse with spacing between the tiles).
Expected Result
excalibur-tiled should load the tileset correctly.
Actual Result
excalibur-tiled loads the tiles in a garbled way, some are transparent, some are the wrong tiles.
Environment
Current Workaround
Creating a new tileset in Tiled without margin works.
The text was updated successfully, but these errors were encountered: