englercj / phaser-tiled

A tilemap implementation for phaser focusing on large complex maps built with the Tiled Editor.
MIT License
290 stars 31 forks source link

Create tiledmap from already loaded assets #49

Closed anthonysapp closed 8 years ago

anthonysapp commented 8 years ago

I've got a custom asset management tool that I use to load all Phaser assets. Basically, it wraps the Phaser Loader and does a bunch of other stuff, including loading all assets by game state, from an external json file.

My question is, assuming all my assets for the tilemap are loaded, is there an easy way to skip doing the loading using the cachekey utility and just add a tiledmap from already pre-loaded assets?

englercj commented 8 years ago

Not really, right now everything is pulled from the Phaser game cache. You have one of two options:

  1. Insert your data into the Phaser cache using the cacheKey utility so that we can pull stuff out
  2. Write PR that allows the classes to take either a string key or the actual map data.

Problem is there are many things you would need to pass in, the map json/xml data, all the images for the tilesets, etc. I haven't thought of a great way to do that, but I'm up for a PR of something that makes it happen!

anthonysapp commented 8 years ago

Cool, marking as closed, and will try implementing myself. Thanks!