Idiomatic way for resourse loading (Tiled)

(TatriX) #1

Hi!

I’m using amethyst/tiles feature with tiled.
I insert resource tiled::Map in on_start method as well as create TileMap entity.

Tile trait implementation fetches tiled::Map resource from the world to decide which sprite to render.
This approach works just fine. The only issue is that I need to load tiled files myself.
So I’ve tried implementing custom Asset and Format for tiled .tmx files.
After loader.load("map.tmx") I’m getting a Handle, not tiled::Map so I cannot access map data.

What should I do if I want to have only one resource with the map data but at the same time I’d like to use Loader to load the data?