The way Flame handles assets is currently a bit ambiguous, images go through the Images
class while other type of files (for instance tiled maps) have their own parsers in the bridge packages. This is also not the common way most Flutter developers are used to handling assets.
Flutter already provides a way to load assets, that we internally already use, namely the AssetBundle
class. This class however still does not provide direct ways to load asset types like images, tiled map and others. But we can extend it, and it even has a CachedAssetBundle
variant that does caching for us.
My suggestion is to create a FlameAssetBundle
that can load different kinds of types like images and tiled map (through extensions provided in the bridge package). This allows us to make it more user-friendly, flutter developers know about rootBundle
and AssetBundle
and allows our bridge packages to make loading assets for their implementation much easier.
None to my knowledge, the Images
can still exist for backwards compatibilty but under the hood it can use the Flame bundle system.
I already have been using this idea for my own games and would love to provide my implementation as a PR if we all agree on this idea.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too