New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Use Flame.images
in flame_texturepacker
#3103
feat!: Use Flame.images
in flame_texturepacker
#3103
Conversation
Flame.images
in flame_texturepackerFlame.images
in flame_texturepacker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest that we let the user pass in an optional custom cache too, but since that argument will have to go through so many methods I think we can leave that as a follow-up for when someone needs it.
If I counted correctly it would be ~6 methods with a maximum call chain of 3. This would then still be kind of reasonable I guess. If this route is taken would you suggest we keep a Happy to adjust that @spydon |
Alright, if you want to adjust it you can follow how it's done in the parallax:
I think the breaking change is still worth it, it's good to default to |
@spydon adjusted to pass the custom cache through. Also applying the custom cache for the Assets Loading. Also adjusted the PR description to include the 3rd way of migrating the version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
In this [PR](#3103) we updated the code to use `Flame.images` because of this change now the atlas file and the sprite sheet both must be under the `assets/images/` directory. Trying to run the example project will crash because the atlas find cannot be found. This MR fixes the problem by loading the `.atlas` file correctly from the images directory. Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Description
Using
Flame.images
instead of a customImageCache
inTexturePackerAtlas
allowing users to override theImageCache
's prefix to support loading Atlas Animations from different packages.Due to this change the
prefix
of the usedImageCache
changed fromassets/
toassets/images/
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Migration instructions
Either move all sprites and textures from
assets/
toassets/images/
or provide a custom cache usingimages: Images(prefix: 'assets/')
or useFlame.images.prefix = 'assets/'
to point to the same Location as before. Be aware that the latter approach might interfere with loading other Image AssetsRelated Issues
Closes #3096