flame_tiled: tileset image in a subfolder of an external .tsx resolves to the wrong path
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with TiledAtlas.fromTiledMap in lib/src/tile_atlas.dart and trace how the map path, external .tsx path, and image source are combined. Compare the failing sets/edge.tsx and img/edge.png case with the ../tilesets/a.tsx case that already works. Done means external tileset images resolve relative to the .tsx folder and the resulting path is normalized; an open linked pull request #4118 is already addressing this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
TiledComponent.load loads a tileset's image from the wrong folder when the external tileset and
its image paths have the same number of segments.
Map assets/tiles/edge.tmx:
<tileset firstgid="1" source="sets/edge.tsx"/>
Tileset assets/tiles/sets/edge.tsx:
<image source="img/edge.png" width="32" height="16"/>
Tiled resolves the image relative to the .tsx: assets/tiles/sets/img/edge.png.
flame_tiled 3.1.2 loads img/edge.png relative to the map folder instead
(assets/tiles/img/edge.png), so loading fails with Unable to load asset.
Why
TiledAtlas.fromTiledMap (lib/src/tile_atlas.dart) only prepends the tileset's folder when the
paths' segment counts differ:
if (tilesetParts.length != imageParts.length) {
tileImageSource = [...tilesetParts.sublist(0, tilesetParts.length - 1), ...imageParts].join('/');
}
sets/edge.tsx and img/edge.png both have 2 segments, so no join happens. ../tilesets/a.tsx +
a.png (3 vs 1) works, which is probably why this hasn't come up.
Expected
The image path is always resolved against the folder of the file that declares it (the .tsx
for external tilesets, the map for embedded ones), then normalized, the way Tiled does it.
Versions
flame 1.38.2, flame_tiled 3.1.2, tiled 0.11.1, Flutter 3.44.2, macOS. Possibly relevant to
#4015 (new imagesDirectory resolution) and #4073 (tiled 0.12 loader).
A minimal reproduction (generated assets + app) is available if useful.
- Lenguaje dominante
- Dart
- Estrellas
- 10.8k
- Forks
- 1.1k
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 50
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de flame-engine/flame
-
enhancement v2
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
flame-engine/flame#4116 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
flame-engine/flame#4063 ·
Los mantenedores suelen responder en 1 día
-
TextComponent shadows are not affected by OpacityEffectPosiblemente ocupada @spydon la tomó hace 38 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
flame-engine/flame#4013 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
flame-engine/flame#4012 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
flame-engine/flame#3974 · 6 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de flame-engine/flame
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
jhomlala/betterplayer#1599 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Windows:开启 Flutter windowing 后对话框被提升为原生窗口,首个 ShowWindow 死锁导致整个应用卡死(设置 → 远程访问端口 100% 复现)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AimesSoft/NipaPlay-Reload#1021 ·
Los mantenedores suelen responder en 1 día
-
enhancement triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
fluttercommunity/plus_plugins#4004 ·
Los mantenedores suelen responder en 1 día
-
agent:ready bug P2 · 中 健壮性 区域: 启动与合规 待验证 隐私与合规
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
ASDW51/DanmuFloat#106 ·
Los mantenedores suelen responder en 1 día
-
c: proposal p: go_router package team-ecosystem
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
flutter/flutter#194542 · 1 comentario ·
Los mantenedores suelen responder en 1 día