Commit graph

338 commits

Author SHA1 Message Date
Richard Davey
02554984fe Removed KeyboardManager and replaced with KeyboardPlugin
The `KeyboardManager` class has been removed. It has been replaced with `KeyboardPlugin` which is now an Input level plugin, that registers itself with the new `InputPluginCache`. The Input Plugin class (which belongs to a Scene) will now automatically inject registered plugins into itself on boot. Every Scene has its own instance of the Input Plugin (if enabled in the scene plugins), which in turn has its own instance of the KeyboardPlugin. The `InputManager` no longer has any reference to the Keyboard class at all. The benefits of this are two-fold: First, it allows you to now entirely exclude all of the keyboard classes from a custom build, saving a lot of space if not required. Secondly, it means that the Scenes themselves are now responsible for keyboard events, where-as before they were entirely global. This means a Scene can be paused and stop processing keyboard events, and stop having its Key objects updated, while another Scene can still carry on doing this. It also prevents key related callbacks in sleeping Scenes from being fired (which resolves issue #3733, thanks @JoeMoov2)
2018-06-08 15:16:35 +01:00
Richard Davey
43fd10bbc1 ScenePlugin.run is a new method that will run the given Scene and not change the state of the current Scene at all. If the scene is asleep, it will be woken. If it's paused, it will be resumed. If not running at all, it will be started. 2018-06-08 15:07:00 +01:00
Richard Davey
a2c20a9aa7 lint fixes 2018-06-05 01:08:32 +01:00
Richard Davey
c0ac1259ea Significant Data Manager overhaul.
Adds in values property, removes redundant functions, streamlines the event flow, adds features to the get and set handlers.
2018-06-05 01:01:13 +01:00
Richard Davey
a0e4a07920 In TimeStep.step the rawDelta and delta values are checked to make sure they are non-negative, which can happen in Chrome when the delta is reset and out of sync with the value passed to Request Animation Frame. Fix #3088 2018-06-04 22:29:58 +01:00
Richard Davey
dced3a2090 Updated log. 2018-06-04 22:15:05 +01:00
Richard Davey
719a2eedca Interactive Objects inside of Containers would still fire their input events even if the Container (or any ancestor) was set to be invisible. Objects now check their ancestor tree during the input cull and now properly skip input events if not visible. Fix #3620 2018-06-04 21:04:27 +01:00
Richard Davey
a804d7fc75 Formatting fixes. 2018-06-04 17:26:47 +01:00
Richard Davey
8aacb7fe77 Typo 2018-06-04 17:13:38 +01:00
Richard Davey
6092088afc Updated change log. 2018-06-04 17:03:38 +01:00
Richard Davey
699951bc40 Updated change log 2018-06-04 16:49:17 +01:00
Richard Davey
ecfbea8bd4 Updated change log. 2018-06-04 15:19:32 +01:00
Richard Davey
130ab75c74 Updated change log 2018-06-04 13:24:55 +01:00
Richard Davey
e7fec396e1 If a Body collides with a Static Body it will now set the blocked properties accordingly 2018-06-03 21:17:33 +01:00
Richard Davey
e3e4130a15 Updated log 2018-06-03 17:08:16 +01:00
Richard Davey
fb817833a5 Updated change log 2018-06-02 12:45:34 +01:00
Richard Davey
95826aa95f Merge branch 'master' of https://github.com/photonstorm/phaser 2018-06-01 19:19:21 +01:00
Richard Davey
2a4e6ae56e Updated log with Arcade Physics changes 2018-06-01 19:19:18 +01:00
Chris Andrew
4750e92be4 Fixed a method signature issue with the Animation component's 'remove' event handler.
This prevented removed animations from stopping correctly, when they were removed from the AnimationManager.
2018-06-01 14:37:15 +01:00
Richard Davey
2dc7f1dc4e Updated change log 2018-06-01 00:06:05 +01:00
Chris Andrew
b2ef86534e Updated change log. 2018-05-31 18:05:54 +01:00
Chris Andrew
ee6f48b10c Fixed an incorrect usage of Math.abs() in Quaternion.calculateW() (thanks @qxzkjp). 2018-05-31 18:05:31 +01:00
Chris Andrew
fb55b9bb44 Updated change log. 2018-05-31 17:44:22 +01:00
Richard Davey
f45ab89f8d The ForwardDiffuseLightPipeline, used by the Lights system, now sets a flag if the Scene doesn't contain any lights. All of the Game Objects now check this flag and don't even bother adding themselves to the batch if there are no lights in the Scene, as they'd never render anyway. This also avoids the ghost-image problem if you swap Scenes to a new Scene with the Light Manager enabled, but no actual lights defined. Fix #3707 2018-05-31 16:57:30 +01:00
Richard Davey
20e21ff5ac Rectangle.RandomOutside is a new function that takes two Rectangles, outer and inner, and returns a random point that falls within the outer rectangle but is always outside of the inner rectangle. 2018-05-31 14:07:39 +01:00
Richard Davey
a739be27a1 RenderTexture.resize will allow you to resize the underlying Render Texture to the new dimensions given. Doing this also clears the Render Texture at the same time 2018-05-29 12:07:40 +01:00
Richard Davey
a7da8dc28f The Canvas RenderTexture drawImage method incorrectly set the values of the frame, causing them to appear wrongly scaled in the canvas renderer. Fix #3710 2018-05-29 11:50:23 +01:00
Richard Davey
d2981a8576 Preparing for 3.10 dev work 2018-05-25 00:21:01 +01:00
Richard Davey
23d3fe3774 3.9.0 Release 2018-05-24 23:42:40 +01:00
Richard Davey
6cfc5d49e7 The AudioContextMonkeyPatch has been updated to use an iife. Fix #3437 2018-05-24 23:17:33 +01:00
Richard Davey
3d9da060c5 Camera.shake would not effect dynamic tilemap layers. Fix #3669 2018-05-24 23:02:59 +01:00
Richard Davey
7d692bc7dc Added Camera.followOffset property and helper methods setLerp and setFollowOffset. 2018-05-24 17:30:28 +01:00
Richard Davey
f8cda698e4 Added Camera.lerp and implemented linear interpolation when following targets 2018-05-24 15:29:38 +01:00
Richard Davey
57c2ccbf5e Formatting fix and doc update 2018-05-24 14:03:29 +01:00
Richard Davey
35a5a6d2da updated change log 2018-05-24 13:49:51 +01:00
Richard Davey
68303622f2 Setting an existing Game Object as a static Arcade Physics body would sometimes incorrectly pick-up the dimensions of the object, such as with TileSprites. Fix #3690 2018-05-23 15:17:26 +01:00
Richard Davey
6eea9db9b2 jsdoc fixes. FIx #3694 2018-05-23 15:04:54 +01:00
Richard Davey
63bb14c37c Log update 2018-05-23 14:58:44 +01:00
Richard Davey
b6768f8a0f Added contributor 2018-05-22 23:23:01 +01:00
Richard Davey
8aa116ca4b The dragend event would be broadcast even if the drag distance or drag time thresholds were not met. Fix #3686 2018-05-22 21:24:50 +01:00
Richard Davey
de8462efed Added default values and tidied up docs a little 2018-05-22 16:19:18 +01:00
Richard Davey
a9cbf23b4e Log update 2018-05-22 16:13:05 +01:00
Richard Davey
457ab68ef4 Container updated to use preDestroy and remove event hooks 2018-05-22 16:02:28 +01:00
Richard Davey
0b1d32b571 New registerFileType argument, new Global Plugin mapping and createEntry method
* 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.
* 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.
* PluginManager.createEntry is a new private method to create a plugin entry and return it. This avoids code duplication in several other methods, which now use this instead.
2018-05-18 18:43:27 +01:00
Richard Davey
56888fd5db Game will now auto-focus and prevent focus loss for the keyboard when clicking away and back again
* Game has a new property `hasFocus` which is a read-only boolean that lets you know if the window the game is embedded in (including in an iframe) currently has focus or not.
* Game.Config has a new property `autoFocus`, which is `true` by default, and will automatically call `window.focus()` when the game starts.
* Clicking on the canvas will automatically call `window.focus`. This means in games that use keyboard controls if you tab or click away from the game, then click back on it again, the keys will carry on working (where-as before they would remain unfocused)
2018-05-18 17:37:45 +01:00
Richard Davey
7c28a7bd08 Bob.reset will now reset the position, frame, flip, visible and alpha values of the Bob, plus JSDocs completed. 2018-05-18 14:44:25 +01:00
Richard Davey
9429a28574 The Particle tint value was incorrectly calculated, causing the color channels to be inversed. Fix #3643 2018-05-18 13:16:17 +01:00
Richard Davey
ef2b8d68b6 setInteractive now works on non-zero sized Containers. Sorting fixed. 2018-05-18 12:48:12 +01:00
Richard Davey
919676ae10 PluginManager.destroy didn't reference the plugin correctly, throwing an Uncaught TypeError if you tried to destroy a game instance. Fix #3668 2018-05-17 12:16:14 +01:00
Richard Davey
b4f371edc5 Preparing for 3.9 dev 2018-05-16 22:05:25 +01:00