Skip to content

Commit 360d744

Browse files
committed
Camera.unfollow allows you to easily unfollow a tracked object (thanks @alvinsight, phaserjs#755)
1 parent 56d7dcf commit 360d744

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Version 2.0.4 - "Mos Shirare" - in development
133133
* 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.
134134
* 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.
135135
* Timer.timeCap is a new setting allowing your Timers to protect against unexpectedly large delta timers (such as raf de-vis or CPU grind).
136+
* Camera.unfollow allows you to easily unfollow a tracked object (thanks @alvinsight, #755)
136137

137138

138139
### Bug Fixes

src/core/Camera.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ Phaser.Camera.prototype = {
167167

168168
},
169169

170+
/**
171+
* Sets the Camera follow target to null, stopping it from following an object if it's doing so.
172+
*
173+
* @method Phaser.Camera#unfollow
174+
*/
175+
unfollow: function () {
176+
177+
this.target = null;
178+
179+
},
180+
170181
/**
171182
* Move the camera focus on a display object instantly.
172183
* @method Phaser.Camera#focusOn

0 commit comments

Comments
 (0)