bevy_ecs_ldtk icon indicating copy to clipboard operation
bevy_ecs_ldtk copied to clipboard

Rectangular tile index incorrect when not a multiple of tile width/height

Open timkurvers opened this issue 3 years ago • 3 comments

This seemingly occurs when a rectangle of tiles is chosen for an entity, and the offset of this rectangle is not a multiple of the tile width or height.

Most likely a floor-vs-ceil issue in #[sprite_sheet_bundle], but I am not super familiar with the intricacies involved here.

More than happy to provide a reproduction case if required.


Compare this LDtk screenshot:

Screenshot 2022-08-07 at 10 14 01

With the bevy_ecs_ldtk rendered result (both entities on the right are off by one column and row respectively):

Screenshot 2022-08-07 at 10 14 15

timkurvers avatar Aug 07 '22 08:08 timkurvers

For your tilesets are you using any spacing/padding? That causes me issues sometimes

Zak0749 avatar Aug 07 '22 08:08 Zak0749

For your tilesets are you using any spacing/padding? That causes me issues sometimes

No spacing/padding on the tileset.

Only difference between the entities is the rectangle selection (as far as I can tell):

Screenshot 2022-08-07 at 10 13 38 Screenshot 2022-08-07 at 10 13 50

timkurvers avatar Aug 07 '22 08:08 timkurvers

Thanks for the issue. I don't think using selecting a rectangle for the entity visual was a use case I was targeting when writing this plugin, so it makes sense that it doesn't quite work. I'm actually kind of surprised that it almost works now.

I agree, it's almost definitely a ceiling vs floor issue.

Since this isn't explicitly supported, I've changed this from a bug to an enhancement, and removed it from the 0.4 milestone.

Trouv avatar Aug 17 '22 04:08 Trouv