cc.Class({
  properties: {
    _context: null,
  },

  setContext(ctx) {
    this._context = ctx;
  },

  ctor() {},

  toTop(item) {
    item.y = this._context.bgHeight / 2;
    item.anchorY = 1;
    item.scale = this._context.bgWidth / item.width;
  },

  toBottom(item) {
    item.y = -this._context.bgHeight / 2;
    item.anchorY = 0;
    item.scale = this._context.bgWidth / item.width;
  },

  toLeft(item) {
    item.x = -this._context.bgWidth / 2;
    item.anchorX = 0;
    item.scale = this._context.bgHeight / item.height;
  },

  toRight(item) {
    item.x = this._context.bgWidth / 2;
    item.anchorX = 1;
    item.scale = this._context.bgHeight / item.height;
  },
});
