microspace

Reload layer without destroying the map

Recommended Posts

Hello! I want to reload map, but this time without destroying map object. Previously I was doing it this way:

Create:

map = TopDownGame.game.add.tilemap("mytilemap");   
map.addTilesetImage('tileSheet', 'myTiles');
flour = map.createLayer('flour');

Destroy and recreate:

map.destroy();
flour.destroy();

map = TopDownGame.game.add.tilemap("mytilemap");   
map.addTilesetImage('tileSheet', 'myTiles');
flour = map.createLayer('flour');

 But here I have to destroy map object too. Is there a way to do this without destroying map object?

(I now that I can always use `putTileWorld`)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.