docs: function (tile, tileh, url, map, paddingX, paddingY) {
          var spriteName, temp, x, y, w, h, 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);
  
          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 (spriteName in map) {
                      Crafty(spriteName).each(function () {
                          this.ready = true;
                          this.trigger("Change");
                      });
                  }
              };
          }
  
          for (spriteName in map) {
              if (!map.hasOwnProperty(spriteName)) continue;
  
              temp = map[spriteName];
              x = temp[0] * (tile + paddingX);
              y = temp[1] * (tileh + paddingY);
              w = temp[2] * tile || tile;
              h = temp[3] * tileh || tileh;
  
              //generates sprite components for each tile in the map
              Crafty.c(spriteName, {
                  ready: false,
                  __coord: [x, y, w, h],
  
                  init: function () {
                      this.requires("Sprite");
                      this.__trim = [0, 0, 0, 0];
                      this.__image = url;
                      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.img = img;
  
                      //draw now
                      if (this.img.complete && this.img.width > 0) {
                          this.ready = true;
                          this.trigger("Change");
                      }
  
                      //set the width and height to the sprite size
                      this.w = this.__coord[2];
                      this.h = this.__coord[3];
                  }
              });
          }
  
          return this;
      }