mirror of
https://github.com/wassname/phaser.git
synced 2026-08-11 11:23:06 +08:00
Testing some new Camera tricks.
This commit is contained in:
@@ -78,6 +78,8 @@ Phaser.Camera = function (game, id, x, y, width, height) {
|
||||
* @default
|
||||
*/
|
||||
this._edge = 0;
|
||||
|
||||
this.displayObject = null;
|
||||
|
||||
};
|
||||
|
||||
@@ -166,6 +168,8 @@ Phaser.Camera.prototype = {
|
||||
*/
|
||||
update: function () {
|
||||
|
||||
return;
|
||||
|
||||
// Add dirty flag
|
||||
|
||||
if (this.target !== null)
|
||||
@@ -216,6 +220,8 @@ Phaser.Camera.prototype = {
|
||||
*/
|
||||
checkWorldBounds: function () {
|
||||
|
||||
return;
|
||||
|
||||
this.atLimit.x = false;
|
||||
this.atLimit.y = false;
|
||||
|
||||
@@ -293,6 +299,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", {
|
||||
|
||||
set: function (value) {
|
||||
this.view.x = value;
|
||||
this.displayObject.x = -value;
|
||||
this.checkWorldBounds();
|
||||
}
|
||||
|
||||
@@ -311,6 +318,7 @@ Object.defineProperty(Phaser.Camera.prototype, "y", {
|
||||
|
||||
set: function (value) {
|
||||
this.view.y = value;
|
||||
this.displayObject.y = -value;
|
||||
this.checkWorldBounds();
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -54,12 +54,13 @@ Phaser.World.prototype = {
|
||||
*/
|
||||
boot: function () {
|
||||
|
||||
this.group = new Phaser.Group(this.game, null, '__world', false);
|
||||
|
||||
this.camera = new Phaser.Camera(this.game, 0, 0, 0, this.game.width, this.game.height);
|
||||
this.camera.displayObject = this.group;
|
||||
|
||||
this.game.camera = this.camera;
|
||||
|
||||
this.group = new Phaser.Group(this.game, null, '__world', true);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -77,7 +78,7 @@ Phaser.World.prototype = {
|
||||
{
|
||||
var currentNode = this.game.stage._stage.first._iNext;
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
if (currentNode['preUpdate'])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user