Open shoaib-xo opened 1 year ago
I resized all images to be of same size and that fixed the issue. I'm not sure though whether its still something that can be fixed or maybe converted into an improvement task. Tiled seems to work fine with the same tilesets.
I'll convert it to a improvement task. Thanks for creating the zapp link, it makes it much easier to understand the problem. :)
Is the issue here just that the tiled layers here used different sizes, while the tiled flame package expects them to be identical?
Is the issue here just that the tiled layers here used different sizes, while the tiled flame package expects them to be identical?
Indeed, that's how I remember it at least.
I've investigated this issue and there's a few changes to be ok with in order to guarantee the lib behaves as expected. One of the changes would be to remove the tile width and height parameters and let the parsed TMX document dictate those as it should. The Tiled
package already loads the width
and height
of the tiles in the Layer.parse(...)
function.
It will also impact the tileStack()
feature which takes in tile coordinates. But with every layer having potentially different tile dimensions, this will not align in those cases. We would need to provide word pixel (x,y) values and let each recursive layer in that function divide that layer's width and height by that layer's world coords in order to obtain the correct "stacked" tile for that layer.
@TheMaverickProgrammer were you working on a way to solve this? :)
@TheMaverickProgrammer were you working on a way to solve this? :)
Hi. I have recently returned home since the hurricanes. I am fine but still getting settled and unpacking my things. However, as soon as I am able, I can return to this and the other tickets I was working on.
There is a high-risk breaking change necessary to resolve this issue with the tileStack()
method:
We would need to provide world pixel (x,y) values and let each recursive layer in that function divide world coords by that layer's width and height in order to obtain the correct "stacked" tile for that layer.
If you're ok with this, then it can be completed quickly.
If you're ok with this, then it can be completed quickly.
Yes, definitely worth it! We can bump major for flame_tiled the release after it is merged.
flame_tiled:TiledComponent does not render correctly or am I missing something? I have a vanilla simple map (tilesize 128x128) with two tile-layers, ground and objects. The tiles arent rendered at the correct positions. The one thing to note is that the tiles in the layer arent 128x128, however, Tiled renders it correctly.
Current bug behavior
Tiles incorrectly positioned on layer
Expected behavior
Tiles should be rendered as they are in Tiled
Steps to reproduce
https://zapp.run/edit/tilemaperror-z2q06pg2r06
Flutter doctor output
More environment information
flame version: 1.7.2 Platform version affected: Chrome
Log information
More information
Side by side comparison of how the map is rendered in flame and tiled. You can see the tiles are offset and unaligned with the 128x128 tile map.