Skip to content

Commit

Permalink
Camera.unfollow allows you to easily unfollow a tracked object (thanks
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Apr 28, 2014
1 parent 56d7dcf commit 360d744
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Version 2.0.4 - "Mos Shirare" - in development
* Color.HSVColorWheel will return an array with 360 color objects for each segment of an HSV color wheel, you can optionally set the saturation and value amounts.
* Color.HSLColorWheel will return an array with 360 color objects for each segment of an HSL color wheel, you can optionally set the saturation and lightness amounts.
* Timer.timeCap is a new setting allowing your Timers to protect against unexpectedly large delta timers (such as raf de-vis or CPU grind).
* Camera.unfollow allows you to easily unfollow a tracked object (thanks @alvinsight, #755)


### Bug Fixes
Expand Down
11 changes: 11 additions & 0 deletions src/core/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ Phaser.Camera.prototype = {

},

/**
* Sets the Camera follow target to null, stopping it from following an object if it's doing so.
*
* @method Phaser.Camera#unfollow
*/
unfollow: function () {

this.target = null;

},

/**
* Move the camera focus on a display object instantly.
* @method Phaser.Camera#focusOn
Expand Down

0 comments on commit 360d744

Please sign in to comment.