fix: Path Resolution and Region Parsing #3849
Open
s1r1m1r1 wants to merge 5 commits intoflame-engine:mainfrom
Open
fix: Path Resolution and Region Parsing #3849s1r1m1r1 wants to merge 5 commits intoflame-engine:mainfrom
s1r1m1r1 wants to merge 5 commits intoflame-engine:mainfrom
Conversation
…orrectly handle prefixes and different asset types. [flame-engine#3844]
Prepared all packages to be released to pub.dev Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
spydon
reviewed
Mar 6, 2026
Member
spydon
left a comment
There was a problem hiding this comment.
Analyzing flame_texturepacker...
info • The line length exceeds the 80-character limit • lib/src/texture_packer_atlas.dart:268:81 • lines_longer_than_80_chars
info • The line length exceeds the 80-character limit • lib/src/texture_packer_atlas.dart:276:81 • lines_longer_than_80_chars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This proposal introduces several key improvements to
TexturePackerAtlas
to make it more robust when working with modular projects, flutter_gen, and various TexturePacker export settings.
Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
HOTFIX
1. Handling Region Names with File Extensions
Some TexturePacker export configurations include file extensions (e.g., .png) for individual regions within the .atlas file. The current parser treats any line ending in a common image extension as a new page header.
Change: Added "peeking" logic to the parser. If a line ends in an image extension but is immediately followed by region-specific properties (like
bounds:,offsets:), it is correctly treated as a region name rather than a new page.2. Automatic Index Extraction from Numeric Suffixes
Region names often follow conventions like
sprite_01.png,sprite_02.png. In LibGDX/Flame, these are intended to be grouped as the same region with different indexes.Change: If a region name has a numeric suffix (e.g.,
_01) and no explicitindex:property is provided in the atlas file, the suffix is extracted and used as the index. This allows findSpritesByName to correctly identify frames forSpriteAnimation.spriteList.Regression Tests
I've added comprehensive tests in atlas_path_resolution_test.dart covering: