You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,11 @@
14
14
* PluginManager.registerFileType has a new property `addToScene` which allows you to inject the new file type into the LoaderPlugin of the given Scene. You could use this to add the file type into the Scene in which it was loaded.
15
15
* PluginManager.install has a new property `mapping`. This allows you to give a Global Plugin a property key, so that it is automatically injected into any Scenes as a Scene level instance. This allows you to have a single global plugin running in the PluginManager, that is injected into every Scene automatically.
16
16
* Camera.lerp has been implemented and allows you to specify the linear interpolation value used when following a target, to provide for smoothed camera tracking.
17
-
* Camera.startFollow has 2 new arguments: `lerpX` and `lerpY` which allow you to set the interpolation value used when following the target. The default is 1 (no interpolation).
18
-
* Camera.startFollow will now immediately set the camera scrollX and Y values to be that of the target to avoid large initial lerps during the first few preUpdates.
17
+
* Camera.setLerp is a chainable method to set the Camera.lerp property.
18
+
* Camera.followOffset is a new property that allows you to specify an offset from the target position that the camera is following (thanks @hermbit)
19
+
* Camera.setFollowOffset is a chainable method to set the Camera.followOffset property.
20
+
* Camera.startFollow has 4 new arguments: `lerpX` and `lerpY` which allow you to set the interpolation value used when following the target. The default is 1 (no interpolation) and `offsetX` and `offsetY` which allow you to set the follow offset values.
21
+
* Camera.startFollow will now immediately set the camera `scrollX` and `scrollY` values to be that of the target position to avoid a large initial lerps during the first few preUpdates.
* @param {number} [x=0] - The horizontal offset from the camera follow target.x position.
840
+
* @param {number} [y=0] - The vertical offset from the camera follow target.y position.
841
+
*
842
+
* @return {this} This Camera instance.
843
+
*/
844
+
setFollowOffset: function(x,y)
845
+
{
846
+
if(x===undefined){x=0;}
847
+
if(y===undefined){y=0;}
848
+
849
+
this.followOffset.set(x,y);
850
+
851
+
returnthis;
852
+
},
853
+
801
854
/**
802
855
* Sets the background color for this Camera.
803
856
*
@@ -1076,14 +1129,18 @@ var Camera = new Class({
1076
1129
* @param {boolean} [roundPixels=false] - Round the camera position to whole integers to avoid sub-pixel rendering?
1077
1130
* @param {float} [lerpX=1] - A value between 0 and 1. This value specifies the amount of linear interpolation to use when horizontally tracking the target. The closer the value to 1, the faster the camera will track.
1078
1131
* @param {float} [lerpY=1] - A value between 0 and 1. This value specifies the amount of linear interpolation to use when vertically tracking the target. The closer the value to 1, the faster the camera will track.
1132
+
* @param {number} [offsetX=0] - The horizontal offset from the camera follow target.x position.
1133
+
* @param {number} [offsetY=0] - The vertical offset from the camera follow target.y position.
0 commit comments