Skip to content

Commit aee0212

Browse files
committed
Camera.follow now uses the Targets world property to seed the camera coordinates from, rather than its local position. This means Sprites that are members of offset Groups, or transformed display lists, should now be followed more accurately (thanks @rbozan phaserjs#2106)
1 parent 8ad7b25 commit aee0212

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
341341
* Tween.update will now return `false` (flagging the Tween for destruction) should the Tween.target property every become falsey. This can happen if the object the Tween was tracking is destroyed, nulled or generally removed.
342342
* TweenData.repeatTotal is a new property that keeps track of the total number of times the Tween should repeat. If TweenData.start is called, as a result of the Tween repeatCount being > 0 then the child tween resets its total before re-starting.
343343
* The Debug canvas now listens for the ScaleManager.onSizeChange signal and resizes itself accordingly when running under WebGL. This means if your game size changes the Debug canvas won't be clipped off (thanks @francisberesford #1919)
344+
* Camera.follow now uses the Targets `world` property to seed the camera coordinates from, rather than its local position. This means Sprites that are members of offset Groups, or transformed display lists, should now be followed more accurately (thanks @rbozan #2106)
344345

345346
### Bug Fixes
346347

src/core/Camera.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,7 @@ Phaser.Camera.prototype = {
270270
*/
271271
updateTarget: function () {
272272

273-
this._targetPosition.copyFrom(this.target);
274-
275-
if (this.target.parent)
276-
{
277-
this._targetPosition.multiply(this.target.parent.worldTransform.a, this.target.parent.worldTransform.d);
278-
}
273+
this._targetPosition.copyFrom(this.target.world);
279274

280275
if (this.deadzone)
281276
{

0 commit comments

Comments
 (0)