code: function(poly) {
          //create polygon
          if (arguments.length > 1) {
              //convert args to array to create polygon
              var args = Array.prototype.slice.call(arguments, 0);
              poly = new Crafty.polygon(args);
          } else if (poly.constructor === Array) {
              poly = new Crafty.polygon(poly.slice());
          } else {
              poly = poly.clone();
          }
  
          poly.shift(this._x, this._y);
          this.mapArea = poly;
          this.attach(this.mapArea);
          this.trigger("NewAreaMap", poly);
          return this;
      }
docs: @
  #.areaMap
  @comp AreaMap
  @kind Method
  
  @trigger NewAreaMap - when a new areaMap is assigned - Crafty.polygon
  
  @sign public this .areaMap(Crafty.polygon polygon)
  @param polygon - Instance of Crafty.polygon used to check if the mouse coordinates are inside this region
  
  @sign public this .areaMap(Array coordinatePairs)
  @param coordinatePairs - Array of `x`, `y` coordinate pairs to generate a polygon
  
  @sign public this .areaMap(x1, y1,.., xN, yN)
  @param point# - List of `x`, `y` coordinate pairs to generate a polygon
  
  Assign a polygon to the entity so that pointer (mouse or touch) events will only be triggered if
  the coordinates are inside the given polygon.
  
  @example
  ~~~
  Crafty.e("2D, DOM, Color, Mouse")
  .color("red")
  .attr({ w: 100, h: 100 })
  .bind('MouseOver', function() {Crafty.log("over")})
  .areaMap(0, 0, 50, 0, 50, 50, 0, 50);
  
  Crafty.e("2D, Mouse")
  .areaMap([0, 0, 50, 0, 50, 50, 0, 50]);
  
  Crafty.e("2D, Mouse").areaMap(
  new Crafty.polygon([0, 0, 50, 0, 50, 50, 0, 50])
  );
  ~~~
  
  @see Crafty.polygon