flame_tiled: tileset image in a subfolder of an external .tsx resolves to the wrong path
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Dart
- Star
- 10.8k
- Fork
- 1.1k
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 62
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flame-engine/flame
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes sizeCó thể đã có người làm @ufrshubham đã nhận 1 ngày trước. Đang mởbug
flame-engine/flame#4204 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`Có thể đã có người làm @ufrshubham đã nhận 1 ngày trước. Đang mởbug
flame-engine/flame#4203 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resizedCó thể đã có người làm @ufrshubham đã nhận 1 ngày trước. Đang mởbug
flame-engine/flame#4202 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`CameraComponent.setBounds` with `considerViewport: true` only works for bounds that start at (0, 0), at zoom 1Có thể đã có người làm @ufrshubham đã nhận 1 ngày trước. Đang mởbug
flame-engine/flame#4201 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`findPostProcessFromContext` returns `null` for components rendered with `CameraComponent.postProcess`Có thể đã có người làm @ufrshubham đã nhận 1 ngày trước. Đang mởbug
flame-engine/flame#4200 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flame-engine/flame
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
InlitX/GymMane#311 · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
zjs81/meshcore-open#634 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Flutter: _configureLogging passes a log level to rac_configure_logging, which expects an environmentĐang mởbinding:flutter bug p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
RunanywhereAI/runanywhere-sdks#1246 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Remove Info buttonĐang mởenhancement user request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
mill-road-winter-fair/mill_road_winter_fair_app#646 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] 悬浮宠物在 App 外、任务进行中也会变淡并停止动画Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ccch1mneyyy/dsh-Go#426 ·
Maintainer thường phản hồi trong vòng 1 ngày