Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

flame_tiled: tileset image in a subfolder of an external .tsx resolves to the wrong path

Chiusa
#4,117 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ufrshubham ci sta già lavorando.

Dal 16/10/2026.

  • #4118 di @ufrshubham — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
dart, flutter
Ambito
game-dev

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Dart
Stelle
10.8k
Fork
1.1k
Merge medio
1g 15h
PR unite (30g)
50

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flame-engine/flame

Tutte le issue di flame-engine/flame

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.