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
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,14 @@ one set of bindings ever created, which makes things a lot cleaner.
137
137
*`Camera.centerOnX` will move the camera horizontally to be centered on the given coordinate, without changing its vertical placement.
138
138
*`Camera.centerOnY` will move the camera vertically to be centered on the given coordinate, without changing its horizontally placement.
139
139
*`AnimationManager.exists` is a new method that will check to see if an Animation using the given key already exists or not and returns a boolean.
140
+
*`animationstart-key` is a new Animation key specific event emitted by a Game Object. For example, if you had an animation with a key of 'explode' you can now listen for `animationstart-explode`.
141
+
*`animationrestart-key` is a new Animation key specific event emitted by a Game Object. For example, if you had an animation with a key of 'explode' you can now listen for `animationrestart-explode`.
142
+
*`animationcomplete-key` is a new Animation key specific event emitted by a Game Object. For example, if you had an animation with a key of 'explode' you can now listen for `animationcomplete-explode`.
143
+
*`animationupdate-key` is a new Animation key specific event emitted by a Game Object. For example, if you had an animation with a key of 'explode' you can now listen for `animationupdate-explode`.
144
+
* The Animation class now extends the Event Emitter and dispatches events itself. This allows you to listen for events from a specific Animation, rather than via a Game Object. This is handy, for example, if you had an explosion animation that you wanted to trigger a sound effect when it started. You can now listen for the events from the Animation object directly.
145
+
* The Animation class now emits the `start` event when played (either forward, or in reverse) by any Game Object.
146
+
* The Animation class now emits the `restart` event when it restarts playing on any Game Object.
147
+
* The Animation class now emits the `complete` event when it finishes playing on any Game Object.
140
148
141
149
### Updates
142
150
@@ -160,9 +168,11 @@ one set of bindings ever created, which makes things a lot cleaner.
160
168
*`Graphics.fill` is a new alias for the `fillPath` method, to keep the calls consistent with the Canvas Rendering Context API.
161
169
*`LoaderPlugin.sceneManager` is a new property that is a reference to the global Scene Manager, useful for Plugins.
162
170
* Whenever `Camera.roundPixels` was enabled it would use a bitwise operation to truncate the float (`x |= 0`) - this has been replaced across all files that used it, with a call to `Math.round` instead. This gives far better results when zooming cameras both in and out of a Scene, stopping thin gaps appearing between closely packed Game Objects.
163
-
*`AnimationManager.create` will now return a boolean `false`is the given key is invalid (i.e. undefined or falsey).
171
+
*`AnimationManager.create` will now return a boolean `false`if the given key is invalid (i.e. undefined or falsey).
164
172
*`AnimationManager.create` will no longer raise a console warning if the animation key is already in use. Instead, it will return the animation belonging to that key. A brand new animation will only be created if the key isn't already in use. When this happens, the `add` event is emitted by the Animation Manager. If no event is emitted, the animation already existed.
165
173
*`ArcadePhysics.Body.destroy` will now only add itself to the World `pendingDestroy` list if the world property exists. This prevents `Cannot read property 'pendingDestroy' of undefined` errors if you try to delete a physics body in a callback and then immediately change Scene (which tells the physics work to also delete all bodies)
174
+
* The Animation Component `restart` method has had is sole `key` argument removed. Previously, you had to pass in the key of the animation you wished to reverse, but now you can just call the method directly, and as long as there is an animation playing, it will automatically start playing in reverse, without the nee for a key (the way it should have been originally)
175
+
*`Animation.play` and `playReverse` will now accept either a string-based key of the animation to play (like before), or you can pass in an Animation instance, and it will play that animation.
0 commit comments