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
+44-5Lines changed: 44 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,15 +212,12 @@ The way in which Game Objects add themselves to the Scene Update List has change
212
212
* The Spine Plugin `destroy` method will now no longer remove the Game Objects from the Game Object Factory, or dispose of the Scene Renderer. This means when a Scene is destroyed, it will keep the Game Objects in the factory for other Scene's to use. Fix #5279 (thanks @Racoonacoon)
213
213
* `SpinePlugin.gameDestroy` is a new method that is called if the Game instance emits a `destroy` event. It removes the Spine Game Objects from the factory and disposes of the Spine scene renderer.
214
214
215
-
216
-
217
-
218
-
219
215
### Animation API New Features and Updates
220
216
221
217
The Animation API has had a significant overhaul to improve playback handling. Instead of just playing an animation based on its global key, you can now supply a new `PlayAnimationConfig` object instead, which allows you to override any of the default animation settings, such as `duration`, `delay` and `yoyo` (see below for the full list). This means you no longer have to create lots of duplicate animations, just to change properties such as `duration`, and can now set them dynamically at run-time as well.
222
218
223
219
* The `play`, `playReverse`, `delayedPlay` and `chain` Animation Component methods can now all take a `Phaser.Types.Animations.PlayAnimationConfig` configuration object instead of a string as the `key` parameter. This allows you to override any default animation setting with those defined in the config, giving you far greater control over animations on a Game Object level, without needing to globally duplicate them.
220
+
* The `Component.Animation` now handles all of the loading of the animation. It no longer has to make calls out to the Animation Manager or Animation itself and will load the animation data directly, replacing as required from the optional `PlayAnimationConfig`. This improves performance and reduces CPU calls in animation heavy games.
224
221
* The `PlayAnimationConfig.frameRate` property lets you optionally override the animation frame rate.
225
222
* The `PlayAnimationConfig.duration` property lets you optionally override the animation duration.
226
223
* The `PlayAnimationConfig.delay` property lets you optionally override the animation delay.
@@ -238,10 +235,49 @@ The Animation API has had a significant overhaul to improve playback handling. I
238
235
* The `Components.Animation.chain` method docs said it would remove all pending animations if called with no parameters. However, it didn't - and now does!
239
236
* The `Components.Animation.setDelay` method has been removed. It never actually worked and you can now perform the same thing by calling either `delayedPlay` or setting the `delay` property in the play config.
240
237
* The `Components.Animation.getDelay` method has been removed. It never actually worked and you can now perform the same thing by calling either `delayedPlay` or setting the `delay` property in the play config.
241
-
* `Components.Animation._fireStartEvents` is a new internal private method that handles dispatching the animation start events, to cut down on duplicate code.
238
+
* The `Components.Animation.setRepeat` method has been removed. You can achieve the same thing by setting the `repeat` property in the play config, or adjusting the public `repeatCounter` property if the animation has started.
239
+
* `Components.Animation.handleStart` is a new internal private method that handles the animation start process.
240
+
* `Components.Animation.handleRepeat` is a new internal private method that handles the animation repeat process.
241
+
* `Components.Animation.handleStop` is a new internal private method that handles the animation stop process.
242
+
* `Components.Animation.handleComplete` is a new internal private method that handles the animation complete process.
243
+
* `Components.Animation.emitEvents` is a new internal private method that emits animation events, cutting down on duplicate code.
242
244
* The `Components.Animation.restart` method has a new optional boolean parameter `resetRepeats` which controls if you want to reset the repeat counter during the restart, or not.
243
245
* `Animation.getTotalFrames` is a new method that will return the total number of frames in the animation. You can access it via `this.anims.currentAnim.getTotalFrames` from a Sprite.
244
246
* `Animation.calculateDuration` is a new method that calculates the duration, frameRate and msPerFrame for a given animation target.
247
+
* `ANIMATION_UPDATE_EVENT` is a new event that is emitted from an Animation when it is updated, i.e. its frame changes.
248
+
* `ANIMATION_STOP_EVENT` is a new event that is emitted from an Animation when it is stopped before it reaches completion.
249
+
* `SPRITE_ANIMATION_STOP_EVENT` is a new event that is emitted from a Sprite when its current animation is stopped before it reaches completion.
250
+
* `SPRITE_ANIMATION_KEY_STOP_EVENT` is a new event that is emitted from a Sprite when its current animation is stopped before it reaches completion. This is a dynamic event name and carries the animation key in its title.
251
+
* The `BuildGameObjectAnimation` function now uses the `PlayAnimationConfig` object to set the values.
252
+
* `Sprite.playReverse` is a new method that allows you to play the given animation in reverse on the Sprite.
253
+
* `Sprite.delayedPlay` is a new method that allows you to play the given animation on the Sprite after a delay.
254
+
* `Sprite.stop` is a new method that allows you to stop the current animation on the Sprite.
255
+
* `AnimationManager.load` has been removed as it's no longer required.
256
+
* `AnimationManager.staggerPlay` has been fixed so you can now pass in negative stagger values.
257
+
* `AnimationManager.staggerPlay` has a new optional boolean parameter `staggerFirst`, which allows you to either include or exclude the first child in the stagger calculations.
258
+
* The `Animation.completeAnimation` method has been removed as it's no longer required internally.
259
+
* The `Animation.load` method has been removed as it's no longer required internally.
260
+
* The `Animation.setFrame` method has been removed as it's no longer required internally.
261
+
* The `Animation.getFirstTick` method has no longer needs the `includeDelay` parameter, as it's handled by the component now.
262
+
* The `Animation.getFrames` method has a new optional boolean parameter `sortFrames` which will run a numeric sort on the frame names after constructing them, if a string-based frame is given.
263
+
* `Types.Animations.Animation` has a new boolean property `sortFrames`, which lets Phaser numerically sort the generated frames.
264
+
* `Component.Animation.timeScale` is a new public property that replaces the old private `_timeScale` property.
265
+
* `Component.Animation.delay` is a new public property that replaces the old private `_delay` property.
266
+
* `Component.Animation.repeat` is a new public property that replaces the old private `_repeat` property.
267
+
* `Component.Animation.repeatDelay` is a new public property that replaces the old private `_repeatDelay` property.
268
+
* `Component.Animation.yoyo` is a new public property that replaces the old private `_yoyo` property.
269
+
* `Component.Animation.inReverse` is a new public property that replaces the old private `_reverse` property.
270
+
* `Component.Animation.startAnimation` is a new public method that replaces the old private `_startAnimation` method.
271
+
* The `Component.Animation.getProgress` method has been fixed so it will return correctly if the animation is playing in reverse.
272
+
* The `Component.Animation.remove` method will now always be called when an animation is removed, not just once.
273
+
* The `Component.Animation.getRepeat` method has now been removed. You can get the value from the `repeat` property.
274
+
* The `Component.Animation.setRepeatDelay` method has now been removed. You can set the value using the `repeatDelay` config property, or changing it at run-time.
275
+
* `Component.Animation.complete` is a new method that handles the completion in animation playback.
276
+
* The `Component.Animation.setTimeScale` method has now been removed. You can set the value using the `timeScale` config property, or changing it at run-time.
277
+
* The `Component.Animation.getTimeScale` method has now been removed. You can read the value using the `timeScale` property.
278
+
* The `Component.Animation.getTotalFrames` method has been fixed and won't error if called when no animation is loaded.
279
+
* The `Component.Animation.setYoyo` method has now been removed. You can set the value using the `yoyo` config property, or changing it at run-time.
280
+
* The `Component.Animation.getYoyo` method has now been removed. You can read the value using the `yoyo` property.
245
281
246
282
### New Features
247
283
@@ -269,6 +305,8 @@ The Animation API has had a significant overhaul to improve playback handling. I
269
305
* `ArcadePhysics.disableUpdate` is a new method that will prevent the Arcade Physics World `update` method from being called when the Scene updates. By disabling it, you're free to call the update method yourself, passing in your own delta and time values.
270
306
* `ArcadePhysics.enableUpdate` is a new method that will make the Arcade Physics World update in time with the Scene update. This is the default, so only call this if you have specifically disabled it previously.
271
307
* `ArcadeWorldConfig.customUpdate` is a new boolean property you can set in the Arcade Physics config object, either in the Scene or in the Game Config. If `true` the World update will never be called, allowing you to call it yourself from your own component. Close #5190 (thanks @cfortuner)
308
+
* `Utils.Array.SortByDigits` is a new function that takes the given array of strings and runs a numeric sort on it, ignoring any non-digits.
309
+
* `GroupCreateConfig`, which is used when calling `Group.createMultiple` or `Group.createFromConfig`, can now accept the following new properties: `setOrigin: { x, y, stepX, stepY }` which are applied to the items created by the Group.
272
310
273
311
### Updates and API Changes
274
312
@@ -308,6 +346,7 @@ The Animation API has had a significant overhaul to improve playback handling. I
308
346
* The `Arcade.Body.resetFlags` method has a new optional boolean parameter `clear`. If set, it clears the `wasTouching` flags on the Body. This happens automatically when `Body.reset` is called. Previous to this, the flags were not reset until the next physics step (thanks @samme)
309
347
* `Utils.Array.StableSort` has been recoded. It's now based on Two-Screens stable sort 0.1.8 and has been updated to fit into Phaser better and no longer create any window bound objects. The `inplace` function has been removed, just call `StableSort(array)` directly now. All classes that used `StableSort.inplace` have been updated to call it directly.
310
348
* If a Scene is paused, or sent to sleep, it will automatically call `Keyboard.resetKeys`. This means that if you hold a key down, then sleep or pause a Scene, then release the key and resume or wake the Scene, it will no longer think it is still being held down (thanks @samme)
349
+
* `Actions.setOrigin` will now call `updateDisplayOrigin` on the items array, otherwise the effects can't be seen when rendering.
0 commit comments