mirror of
https://github.com/wassname/phaser.git
synced 2026-08-02 13:00:25 +08:00
Sprite.loadTexture added.
This commit is contained in:
+12
-1
@@ -154,10 +154,21 @@ Phaser.Camera.prototype = {
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Move the camera focus on a display object instantly.
|
||||
* @method Phaser.Camera#focusOn
|
||||
* @param {any} displayObject - The display object to focus the camera on. Must have visible x/y properties.
|
||||
*/
|
||||
focusOn: function (displayObject) {
|
||||
|
||||
this.setPosition(Math.round(displayObject.x - this.view.halfWidth), Math.round(displayObject.y - this.view.halfHeight));
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Move the camera focus to a location instantly.
|
||||
* Move the camera focus on a location instantly.
|
||||
* @method Phaser.Camera#focusOnXY
|
||||
* @param {number} x - X position.
|
||||
* @param {number} y - Y position.
|
||||
|
||||
Reference in New Issue
Block a user