kampar Posted October 1, 2015 Share Posted October 1, 2015 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 More sharing options...
Recommended Posts