docs: function(
          tile,
          tileh,
          url,
          map,
          paddingX,
          paddingY,
          paddingAroundBorder
      ) {
          var spriteName, temp, img;
  
          //if no tile value, default to 1.
          //(if the first passed argument is a string, it must be the url.)
          if (typeof tile === "string") {
              paddingY = paddingX;
              paddingX = map;
              map = tileh;
              url = tile;
              tile = 1;
              tileh = 1;
          }
  
          if (typeof tileh === "string") {
              paddingY = paddingX;
              paddingX = map;
              map = url;
              url = tileh;
              tileh = tile;
          }
  
          //if no paddingY, use paddingX
          if (!paddingY && paddingX) paddingY = paddingX;
          paddingX = parseInt(paddingX || 0, 10); //just incase
          paddingY = parseInt(paddingY || 0, 10);
  
          var markSpritesReady = function() {
              this.ready = true;
              this.trigger("Invalidate");
          };
  
          img = Crafty.asset(url);
          if (!img) {
              img = new Image();
              img.src = url;
              Crafty.asset(url, img);
              img.onload = function() {
                  //all components with this img are now ready
                  for (var spriteName in map) {
                      Crafty(spriteName).each(markSpritesReady);
                  }
              };
          }
  
          var sharedSpriteInit = function() {
              this.requires("2D, Sprite");
              this.__trim = [0, 0, 0, 0];
              this.__image = url;
              this.__map = map;
              this.__coord = [
                  this.__coord[0],
                  this.__coord[1],
                  this.__coord[2],
                  this.__coord[3]
              ];
              this.__tile = tile;
              this.__tileh = tileh;
              this.__padding = [paddingX, paddingY];
              this.__padBorder = paddingAroundBorder;
              this.sprite(
                  this.__coord[0],
                  this.__coord[1],
                  this.__coord[2],
                  this.__coord[3]
              );
  
              this.img = img;
              //draw now
              if (this.img.complete && this.img.width > 0) {
                  this.ready = true;
                  this.trigger("Invalidate");
              }
  
              //set the width and height to the sprite size
              this.w = this.__coord[2];
              this.h = this.__coord[3];
              this._setupSpriteImage(this._drawLayer);
          };
  
          for (spriteName in map) {
              if (!map.hasOwnProperty(spriteName)) continue;
  
              temp = map[spriteName];
  
              //generates sprite components for each tile in the map
              Crafty.c(spriteName, {
                  ready: false,
                  __coord: [temp[0], temp[1], temp[2] || 1, temp[3] || 1],
  
                  init: sharedSpriteInit
              });
          }
  
          return this;
      }