docs: function(x, y) {
          //text based origin
          if (typeof x === "string") {
              if (x === "centre" || x === "center" || x.indexOf(" ") === -1) {
                  x = this._w / 2;
                  y = this._h / 2;
              } else {
                  var cmd = x.split(" ");
                  if (cmd[0] === "top") y = 0;
                  else if (cmd[0] === "bottom") y = this._h;
                  else if (
                      cmd[0] === "middle" ||
                      cmd[1] === "center" ||
                      cmd[1] === "centre"
                  )
                      y = this._h / 2;
  
                  if (
                      cmd[1] === "center" ||
                      cmd[1] === "centre" ||
                      cmd[1] === "middle"
                  )
                      x = this._w / 2;
                  else if (cmd[1] === "left") x = 0;
                  else if (cmd[1] === "right") x = this._w;
              }
          }
  
          // When entity is rotated, we'll need to shift attached entities on origin change
          // The below transformation is equivalent to unrotating, shifting the origin,
          // and then rotating around this new origin
          if (this.rotation) {
              var rad = -this._rotation * DEG_TO_RAD;
              var d_ox = x - this._origin.x;
              var d_oy = y - this._origin.y;
              var cos = rounded_cos(rad);
              var sin = rounded_sin(rad);
              var dx = d_ox * (1 - cos) - d_oy * sin;
              var dy = d_oy * (1 - cos) + d_ox * sin;
              this._cascadeInner(dx, dy, 0, 0);
          }
          this._origin.x = x;
          this._origin.y = y;
  
          if (this._mbr) {
              this._calculateMBR();
          }
  
          // Update position in spatial map
          this._entry.update(this._cbr || this._mbr || this);
  
          this.trigger("OriginChanged");
          this.trigger("Invalidate");
          return this;
      }