code: function () {
  
              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
              var bounds = this.getRenderer().getBounds(this);
              this.getBounds().resize(bounds.width, bounds.height);
  
              // if pre-rendering method is use, create an offline canvas/renderer
              if ((this.preRender === true) && (!this.canvasRenderer)) {
                  this.canvasRenderer = new me.CanvasRenderer(
                      me.video.createCanvas(this.width, this.height),
                      this.width, this.height,
                      { transparent : true }
                  );
              }
          }
docs: called when the layer is added to the game world or a container