code: function onActivateEvent() {
           if (this.animatedTilesets === undefined) {
             this.animatedTilesets = [];
           }
  
           if (this.tilesets) {
             var tileset = this.tilesets.tilesets;
  
             for (var i = 0; i < tileset.length; i++) {
               if (tileset[i].isAnimated) {
                 this.animatedTilesets.push(tileset[i]);
               }
             }
           }
  
           this.isAnimated = this.animatedTilesets.length > 0; // Force pre-render off when tileset animation is used
  
           if (this.isAnimated) {
             this.preRender = false;
           } // Resize the bounding rect
  
  
           this.getBounds().resize(this.width, this.height);
         }
docs: called when the layer is added to the game world or a container