// try to dispose the tilemap:
if (tilemap!= null){
removeChild(tilemap);
tilemap.removeTiles();
}
// create a new one with new width and height:
tilemap = new Tilemap(new_width, new_height, tilesheet);
addChild(tilemap);
However, I’ve noticed that the old tilemap will not get removed from memory, and things get slower.
It’s a pitty that HaxeDevelop 5.3.3.1 doesn’t recognize that useful parameter.
I wonder why is that happening? And i’m also wondering if it is happening as well with other IDEs.
Perhaps HaxeDevelop is tripping over the declaration in Tilemap.hx
We extend Bitmap on Flash Player since DisplayObject cannot be directly extended there. However this is more of an internal implementation detail and not intended as a part of the API