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

Spacing field in tmx file is not working #29

Closed
Jcupzz opened this issue Sep 5, 2021 · 12 comments · Fixed by #41
Closed

Spacing field in tmx file is not working #29

Jcupzz opened this issue Sep 5, 2021 · 12 comments · Fixed by #41
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Jcupzz
Copy link

Jcupzz commented Sep 5, 2021

tiles-5

The above tiles image in Tiled Map Editor with spacing = "1" is working fine. But when it comes to flame_tiled its not working.
The output I get is the below image with those yellow lines which are from the tile image above.

flutter_01

I am just a noob and I don't know if this occurs due to my code. Also, in the example file of flame_tiled repo the image doesn't have those yellow grid lines.

The tmx file can be found in the repo attached below.
Please run this game for further reference
https://github.com/Jcupzz/Super-Mario.git

@luanpotter
Copy link
Member

I think we dont have any example using that field, so it's very likely broken. I will test this against the new flame_tiled

@Jcupzz
Copy link
Author

Jcupzz commented Sep 26, 2021

I think we dont have any example using that field, so it's very likely broken. I will test this against the new flame_tiled

Ok cool!

@Hwan-seok
Copy link
Contributor

Any news?

@spydon
Copy link
Member

spydon commented Jan 19, 2022

Any news?

No news, if anyone want to take on this feel free! :)

@spydon spydon added help wanted Extra attention is needed bug Something isn't working labels Jan 19, 2022
@natebot13
Copy link
Contributor

(tileWidth! + spacing).toDouble(),
(tileHeight! + spacing).toDouble(),

This is the reason. Spacing shouldn't be added to the source rectangle. Removing the spacing fixes the issue.

@spydon
Copy link
Member

spydon commented Mar 25, 2022

(tileWidth! + spacing).toDouble(),
(tileHeight! + spacing).toDouble(),

This is the reason. Spacing shouldn't be added to the source rectangle. Removing the spacing fixes the issue.

Do you want to put up a PR for the fix? :)

@ufrshubham
Copy link
Collaborator

I see a PR is open for this but it is not approved. Is that not the correct fix for this issue?

@spydon
Copy link
Member

spydon commented Apr 25, 2022

I see a PR is open for this but it is not approved. Is that not the correct fix for this issue?

I think it was just forgotten. Would be good if someone depended on the branch and tried the fix.

@ufrshubham
Copy link
Collaborator

ufrshubham commented Apr 25, 2022

@spydon I just tried to test that branch but the problem still persists. After debugging I found out that it was failing because spacing and margin parameters were not copied in _checkIfExtenalTsx() method.

Edit: This is required only for cases where an external tileset file is used. For embedded tilesets, original fix should be enough.

@natebot13
Copy link
Contributor

@ufrshubham interesting, I'm willing to take a look later today.

@natebot13
Copy link
Contributor

This has been fixed with pull request #41 and I believe has been verified by @ufrshubham

@ufrshubham
Copy link
Collaborator

This has been fixed with pull request #41 and I believe has been verified by @ufrshubham

Yes, I've tested that PR and it works.

@spydon spydon closed this as completed in #41 May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants