You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are only fromFile and fromString methods for making RenderableTileMap and cannot make TiledMap directly.
The fromString uses _loadMap to loading TiledMap and loads the image directly at the next line.
As a result, there is no chance of retrieving and manipulating the map's image path before the image is actually loaded.
Imagine that we want to get images from a remote URL.
But _loadImages loads SpriteBatch directly before we know the path of the imageSets of TileMap.
So we cannot inject the image files from a remote URL before flame loads it from local assets.
Any risks?
Misusing of loadMap..? but this isn't very common.
More information
Are you interested in working on a PR for this? YES
It is a long way to go to acheving dynamically fetching maps.. I think this one is starting.
The text was updated successfully, but these errors were encountered:
What could be improved
Change
_loadMap
to public and create new methodstatic Future<RenderableTiledMap> fromMap(TiledMap map, Vector2 destTileSize)
flame/packages/flame_tiled/lib/src/renderable_tile_map.dart
Line 106 in cae8c0c
Why should this be improved
Currently, there are only
fromFile
andfromString
methods for makingRenderableTileMap
and cannot makeTiledMap
directly.The
fromString
uses_loadMap
to loadingTiledMap
and loads the image directly at the next line.As a result, there is no chance of retrieving and manipulating the map's image path before the image is actually loaded.
flame/packages/flame_tiled/lib/src/renderable_tile_map.dart
Line 108 in cae8c0c
Imagine that we want to get images from a remote URL.
But
_loadImages
loads SpriteBatch directly before we know the path of the imageSets of TileMap.So we cannot inject the image files from a remote URL before flame loads it from local assets.
Any risks?
Misusing of loadMap..? but this isn't very common.
More information
Are you interested in working on a PR for this? YES
It is a long way to go to acheving dynamically fetching maps.. I think this one is starting.
The text was updated successfully, but these errors were encountered: