Jump to content

Camera position


kampar
 Share

Recommended Posts

Why Phaser.Game.Camera .x and .y is set on left up corner and .position is on view center? It is very confusing and documentation doesn't tell nothing about this difference.

/*** The Cameras x coordinate. This value is automatically clamped if it falls outside of the World bounds.* @name Phaser.Camera#x* @property {number} x - Gets or sets the cameras x position.*/Object.defineProperty(Phaser.Camera.prototype, "x", {    get: function () {        return this.view.x;    },
/*** The Cameras position. This value is automatically clamped if it falls outside of the World bounds.* @name Phaser.Camera#position* @property {Phaser.Point} position - Gets or sets the cameras xy position using Phaser.Point object.*/Object.defineProperty(Phaser.Camera.prototype, "position", {    get: function () {        this._position.set(this.view.centerX, this.view.centerY);        return this._position;    },
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...