Commit graph

249 commits

Author SHA1 Message Date
Richard Davey
07bb619c5e Added jsdocs 2018-10-19 16:14:51 +01:00
Richard Davey
8a974915d8
Merge pull request #4093 from Cirras/patch-1
Fix Camera culling bugs (Issue #4092)
2018-10-19 13:45:36 +01:00
Richard Davey
4b1c762296 Updated @memberOf to @memberof 2018-10-10 10:49:13 +01:00
Richard Davey
a9063604dc Replace @readOnly with @readonly 2018-10-09 13:40:00 +01:00
Richard Davey
8994d8f13e CameraManager.remove has a new argument runDestroy which, if set, will automatically call Camera.destroy on the Cameras removed from the Camera Manager. 2018-10-05 18:30:00 +01:00
Cirras
1a87cc1f96
Fix Camera culling bugs (Issue #4092)
Make camera culling properly handle the camera's current zoom level and viewport position.
2018-10-06 01:44:14 +10:00
Sergey
948ed58842
#4010 fix
Both values are already scaled to resolution.
2018-09-24 14:34:59 +03:00
Richard Davey
4c6b2cc183 Fixed destroy order 2018-09-14 18:03:51 +01:00
Richard Davey
5ec26fa62d Cameras now emit prerender and postrender events if they are set to render to textures. 2018-09-14 15:53:06 +01:00
Richard Davey
b9318826eb Added jsdocs, setPipeline and clearRenderToTexture methods 2018-09-14 14:03:37 +01:00
Richard Davey
7315ea39b4 Optimized setting the custom flag 2018-09-14 14:03:13 +01:00
Richard Davey
9af2c7e249 The Cameras setScene method, which is called automatically when a new Camera is created, will now call updateSystem which correctly increases the custom viewport counter. This fixes an issue with mini-cams inside of larger cameras not clipping their contents properly. If a Camera is moved to another Scene it also now correctly shrinks the total custom viewport counter. 2018-09-14 12:33:22 +01:00
Richard Davey
5fe6dbbe0c Added more jsdocs 2018-09-13 08:09:44 +01:00
Richard Davey
ef558fea3c Type definition fixes 2018-09-07 17:19:19 +01:00
Richard Davey
cb1c6f614d Preparing for 3.12 release 2018-09-04 15:42:10 +01:00
Richard Davey
ecf952ef77 Removed component code 2018-09-04 15:13:32 +01:00
Richard Davey
89967af66b Fixed Camera input resolution 2018-09-04 14:04:48 +01:00
Richard Davey
0b95ed0478 Fixed scissors when using a small cam with render texture 2018-08-31 16:25:04 +01:00
Richard Davey
eaeab041ee Added render to texture docs 2018-08-23 18:10:55 +01:00
Richard Davey
beb286297c Camera3D Plugin moved out of the main src folder to optional plugin 2018-08-23 13:18:25 +01:00
Richard Davey
764de08ff4 Camera.ignore can now take nested-arrays of Game Objects and also supports both Groups and Containers. 2018-08-08 16:46:14 +01:00
Richard Davey
66afe973af Trying mixins 2018-08-08 01:33:55 +01:00
Richard Davey
3a4bfa679b Added experimental Camera to Render Texture 2018-08-07 16:27:21 +01:00
Richard Davey
8573e60273 No config, no update 2018-08-07 16:25:55 +01:00
Richard Davey
f9e498353d Fixed lack of TempMatrix for Graphics generateTexture 2018-08-06 16:19:30 +01:00
Richard Davey
faeed47b5e eslint fixes 2018-08-06 15:32:08 +01:00
Richard Davey
9675c269e6 Split Camera up into BaseCamera, which Camera now extends. 2018-08-04 13:05:41 +01:00
Richard Davey
fa2b78192c The CameraManager was accidentally adding extra destroy event calls when a Scene was restarted, causing an Uncaught TypeError: Cannot read property 'events' of null when trying to destroy a game instance having swapped from a Scene to another, and back again. Fix #3878 2018-07-31 11:34:59 +01:00
Chris Andrew
1ceec99306 Added missing property documentation to FixedKeyControlConfig (#3874, thanks @guzmonne). 2018-07-31 00:36:04 +01:00
Richard Davey
4bdecf488b jsdocs tweaks 2018-07-26 23:41:52 +01:00
Richard Davey
1a62a3563e Added refs to config and Scene Manager and new customViewport bool 2018-07-26 23:04:53 +01:00
Richard Davey
e851209b41 Camera effects using the new drawFillRect method. 2018-07-26 16:32:31 +01:00
Richard Davey
b6a1033dbd Fixed Camera FX for scaled camera sizes 2018-07-18 15:03:06 +01:00
Richard Davey
25e4993e6f Added x and y getters and new scaled viewport values 2018-07-18 14:32:47 +01:00
Richard Davey
16d597c983 Fixed jsdoc references 2018-07-17 11:43:09 +01:00
Richard Davey
646861425f Added Camera.worldView property and adjusted it to the correct values each frame. 2018-07-12 15:08:29 +01:00
Richard Davey
072cc0e21b Added dirty Camera support and updated internal properties to set the flag 2018-07-12 01:13:34 +01:00
Richard Davey
8c312090da Solidified use of pixelArt mode 2018-06-27 15:27:16 +01:00
Richard Davey
7a23378015 Unified use of roundPixels, antialias and pixelArt modes 2018-06-27 15:15:00 +01:00
Richard Davey
a6ab61dd99 Fixed id use 2018-06-27 13:16:11 +01:00
Richard Davey
ee8e264d5e Return removed total 2018-06-27 13:16:01 +01:00
Richard Davey
2888fe94bd Tweak 2018-06-27 13:05:06 +01:00
Richard Davey
1bfe58ab55 remove can take an array of cameras and also no longer needs total to be > 0 2018-06-27 13:03:40 +01:00
Richard Davey
183f5c4260 CameraManager.getTotal is a new method that will return the total number of Cameras being managed, with an optional isVisible argument, that only counts visible cameras if set. 2018-06-27 12:45:54 +01:00
Richard Davey
f2b7fd0a32 Removed the cameraX properties because they fall out of sync on camera remove 2018-06-27 12:13:37 +01:00
Richard Davey
7aa46657c2 Tidying up jsdocs and changing float to number 2018-06-26 23:19:14 +01:00
Richard Davey
c2fbad8356 Added jsdocs. Now 100% complete! 2018-06-26 17:24:51 +01:00
Richard Davey
ba9890e9f1 lint fix 2018-06-26 16:41:37 +01:00
Richard Davey
237368161b Added Camera.setAlpha method 2018-06-25 16:31:54 +01:00
Richard Davey
51468fdefc Merge branch 'master' of https://github.com/photonstorm/phaser 2018-06-25 16:25:42 +01:00
Richard Davey
6dff47b71d Added Camera.alpha property 2018-06-25 16:11:09 +01:00
Richard Davey
d20188b75d Removed camera pool, renamed current ID and added accessor properties 2018-06-25 16:10:50 +01:00
Richard Davey
6df877cfa3 Docs update 2018-06-23 12:33:20 +01:00
Richard Davey
e53f61d068 CameraManager.resetAll now destroys all current Cameras, resets the camera ID marker to 1 and adds a single new Camera. 2018-06-23 12:33:10 +01:00
Richard Davey
932737343b Added centerOn argument to setBounds and bumped Camera id to be public 2018-06-23 12:18:44 +01:00
Chris Andrew
2388707379 Fixed lint error. Minor documentation fix in 2D camera. 2018-06-21 18:17:00 +01:00
Richard Davey
53cf7d847b Fixed Pan so it updates constantly, allowing Pan + Zoom together 2018-06-21 17:56:27 +01:00
Richard Davey
f4f9a98ac1 Added Camera Zoom Effect 2018-06-21 17:48:11 +01:00
Richard Davey
ec168c4b9b Removed dead code and added jsdocs 2018-06-21 17:19:58 +01:00
Richard Davey
3ece90ad75 Added Camera.getScroll and the new Pan Effect 2018-06-21 17:15:43 +01:00
Richard Davey
472df6a7be Camera.centerOn is a new method that will move the camera so its viewport is centered on the given coordinates. A handy way of jumping to different points around a map without needing to calculate the scroll offsets. 2018-06-21 15:54:54 +01:00
Richard Davey
2ff6845360 Camera.centerToBounds didn't take the bounds offset into account, so bounds at non-zero positions wouldn't center properly. All bounds now center correctly. Fix #3706 2018-06-21 14:03:31 +01:00
Richard Davey
3e3b0d6397 Fixed issue where negative camera bounds wouldn't clamp properly 2018-06-21 12:33:20 +01:00
Richard Davey
c02c9cf2da Fixed camera bounds when bounds are smaller than the viewport 2018-06-21 02:32:24 +01:00
Richard Davey
0b3392fab4 Fixed Camera roundPixels stuttering 2018-06-21 01:59:12 +01:00
Richard Davey
99eb565520 Fixed camera bounds with zoom issue and added new displayWidth / displayHeight properties 2018-06-20 17:42:20 +01:00
Richard Davey
92d06d4742 Removed incorrect application of zoom 2018-06-20 14:52:22 +01:00
Richard Davey
e1151fe436 Removed merge conflicts 2018-06-20 14:29:36 +01:00
Richard Davey
7d573a35eb Added Camera.setDeadzone method, updated startFollow and added jsdocs. 2018-06-20 14:26:36 +01:00
Richard Davey
2b9be45741 Starting Camera.deadzone support 2018-06-19 12:29:04 +01:00
Richard Davey
15b544fc46 jsdoc fixes 2018-06-13 08:37:40 +01:00
Richard Davey
ccf50ff8dc Added Camera.visible property and setter. 2018-06-04 22:12:20 +01:00
Richard Davey
bf2af95930 CameraManager.getCameraBelowPointer has been renamed to getCamerasBelowPointer and it now returns an array of all the cameras below the given pointer, not just the top-most one. The array is sorted so that the top-most camera is at the start of the array. 2018-06-04 22:10:13 +01:00
samme
68ebce077e Add Camera#centerX, Camera#centerY 2018-06-02 21:04:56 -07:00
Chris Andrew
f38a0683ff Updated SmoothStep and SmootherStep documentation. Fixed lint errors. 2018-05-24 18:11:18 +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
9834e9d30b Added followOffset property to Camera target 2018-05-24 17:04:20 +01:00
Richard Davey
9a76f40f55 No such property as target, swap to _follow. 2018-05-24 15:33:49 +01:00
Richard Davey
f8cda698e4 Added Camera.lerp and implemented linear interpolation when following targets 2018-05-24 15:29:38 +01:00
Austyn Studdard
330e039763 fixed #3646 2018-05-19 13:36:42 -05:00
Austyn Studdard
60d35be269 revert 2018-05-19 13:33:04 -05:00
Austyn Studdard
50ce7feb87 fixed issue #3646 2018-05-19 11:46:43 -05:00
Richard Davey
350cb037b7 All systems now register themselves with the new PluginCache 2018-05-15 12:51:50 +01:00
Richard Davey
be330e609e Moved PluginManager to new location 2018-05-10 17:14:33 +01:00
Christian Panadero
5f03557603 Fix camera bound typings
Bounds where not generated with that syntax so I created an entity to
explictly define the camera bounds.

Bounds are there only when the internal property 'useBounds' is there,
so it can be undefined in some cases.
2018-04-28 12:25:07 +01:00
Richard Davey
b0544c73b8 jsdoc fixes 2018-04-18 13:29:22 +01:00
Richard Davey
55965c748f jsdoc fixes 2018-04-18 12:13:49 +01:00
Richard Davey
1be486fab4 destroy only called once, no matter how many times the Scene restarts. Fix #3581 2018-04-17 12:25:45 +01:00
Richard Davey
07a55e5d1f Removed debug call and merged Scene Systems boot and start sequences. Fix #3579 2018-04-17 02:34:07 +01:00
Richard Davey
3c5eab9ee6 Exposed Effects 2018-04-15 23:14:34 +01:00
Richard Davey
ce7d67297f Moving from 3.4.1 to 3.5.0 so we can release new camera fx and scene transitions 2018-04-15 12:44:47 +01:00
Richard Davey
e37b183038 Completed all jsdocs for the Camera class 2018-04-15 05:05:03 +01:00
Richard Davey
ae603240e1 Camera.cullHitTest has been removed. It was never used internally and duplicates the code in Camera.cull. 2018-04-15 04:01:39 +01:00
Richard Davey
84a7b260b3 New flash effect added 2018-04-15 04:00:21 +01:00
Richard Davey
f8d5a7de75 Added more docs and changed default time to 250ms 2018-04-15 03:59:58 +01:00
Richard Davey
595e43aa8b Added new Camera effects system 2018-04-14 17:39:43 +01:00
Richard Davey
1a51e859dd New Camera Shake effect class 2018-04-14 12:35:39 +01:00
Richard Davey
06e5fc0336 Camera extends Event Emitter and moved to effect based system 2018-04-14 12:35:14 +01:00
Richard Davey
6b2307594a Scene plugin flow overhaul
Every Plugin has been updated to correctly follow the same flow through the Scene lifecycle. Instead of listening for the Scene 'boot' event, which is only dispatched once (when the Scene is first created), they will now listen for the Scene 'start' event, which occurs every time the Scene is started. All plugins now consistently follow the same Shutdown and Destroy patterns too, meaning they tidy-up after themselves on a shutdown, not just a destroy. Overall, this change means that there should be less issues when returning to previously closed Scenes, as the plugins will restart themselves properly.
2018-04-13 17:12:17 +01:00
Richard Davey
efe6330a01 Added scaleX/Y getters 2018-04-12 16:27:55 +01:00
Richard Davey
d15d910778 Removed camera.cullTilemap because nothing uses it any more 2018-04-09 16:00:33 +01:00
Richard Davey
441ca3862c Swap for isArray check 2018-04-05 09:23:52 +01:00
Richard Davey
4c116c0af2 Put Fixed and Smoothed aliases back in for now 2018-03-30 12:03:25 +01:00
Richard Davey
88b02a5e35 Renamed the Camera Controls module exports for Fixed to FixedKeyControl and Smoothed to SmoothedKeyControl to match the class names. Fix #3463 2018-03-28 16:24:06 +01:00
orblazer
7a33233013 Fix types in Cache and Cameras 2018-03-27 13:51:45 +02:00
orblazer
ed1f2a7011 Fix wrong types 2018-03-22 13:51:30 +01:00
orblazer
5a518f2e5f Fix "object" types on Camera and GameObjecs 2018-03-20 23:28:26 +01:00
orblazer
37b6fc5862 Fix many multiple types 2018-03-20 15:58:02 +01:00
Richard Davey
75bb9d92a9 Camera.fadeIn is a new method that will fade the camera in from a given color (black by default) and then optionally invoke a callback. This is the same as using Camera.flash but with an easier to grok method name. Fix #3412 2018-03-20 00:10:55 +00:00
Richard Davey
00a3f71859 Modified camera effect durations and prevented callbacks from being overwritten 2018-03-19 23:53:03 +00:00
Richard Davey
18c327e743 Effect callbacks now pass the camera. Tidied up potential infinity divides. 2018-03-19 23:29:15 +00:00
Jeroen Reurings
ed3dc2b9b4 Added @since 3.3.0 to new callback method comments. 2018-03-19 22:25:19 +01:00
Jeroen Reurings
6ada1ec2f3 Merge branch 'master' of https://github.com/photonstorm/phaser 2018-03-19 20:31:10 +01:00
Jeroen Reurings
a759266064 Changed default values of effect callbacks to null instead of undefined;
Removed @since JSDoc comments for newly added class methods (because it's still unknown in which version they will be added).
2018-03-19 19:38:43 +01:00
Richard Davey
ff7119dfc1
Merge pull request #3422 from orblazer/fix-types
Fix types and begin object TypeDef
2018-03-19 17:16:45 +00:00
orblazer
45158c2fbd Update JSDoc on Animations and Boot 2018-03-19 18:13:33 +01:00
Richard Davey
d551ef3d29 Added RayDef 2018-03-19 16:34:33 +00:00
orblazer
0ca95676ba Update JSDoc on Cameras 2018-03-19 17:21:25 +01:00
Jeroen Reurings
9006f19f41 Added callbacks to Shake, Fade and Flash effects, so you don't have to use a delayed call to trigger something after an effect is completed;
Moved the shake function next to the other effect functions.
2018-03-19 16:21:48 +01:00
orblazer
c3fb72780b Update JSDoc on Cameras 2018-03-19 01:49:29 +01:00
Richard Davey
cc0998660e Updated jsdocs 2018-03-18 13:43:37 +00:00
Bugi Görtz
b977f096f8 fixed getCamera in CameraManager (2d/3d) to work correctly; forEach()-iterator doesn't return values
(https://hacks.mozilla.org/2015/04/es6-in-depth-iterators-and-the-for-of-loop/)
2018-03-15 17:12:06 +01:00
Bugi Görtz
5af8e745d1 fixed getCamera in CameraManager to work correctly; forEach()-construct can't return values
(https://hacks.mozilla.org/2015/04/es6-in-depth-iterators-and-the-for-of-loop/)
2018-03-15 16:58:05 +01:00
brandonvdongen
143d598780
fixed lint issue 2018-03-09 07:26:09 +01:00
brandonvdongen
08a02c4675 fixed camera offset when combining zoom+follow 2018-03-09 00:07:42 +01:00
Richard Davey
31f331de98 Added CameraManager.resize method. 2018-02-28 17:19:10 +00:00
Richard Davey
26f0578261 jsdoc fixes 2018-02-22 01:07:30 +00:00
Felipe Alfonso
50c79c14af Removed double rounding to pixel on rendering routines.
Fixed rounding pixel issue when camera is shaking
2018-02-19 17:38:40 -03:00
Richard Davey
86f00eeb52 eslint fixes 2018-02-16 18:17:51 +00:00
Richard Davey
8425629165 jsdoc fixes. 2018-02-12 23:51:47 +00:00
Richard Davey
2813ac8162 Moved PluginManager and merged configs into single root file for easier changing. 2018-02-12 23:03:48 +00:00
Richard Davey
ae3cd50356 Fixed jsdocs 2018-02-12 21:39:26 +00:00
Felipe Alfonso
9b2741387b Resolution affecting camera display 2018-02-12 16:03:13 -03:00
Richard Davey
d1f5f8a82b Added jsdocs 2018-02-12 16:01:21 +00:00
Richard Davey
8de078d333 Added jsdocs 2018-02-12 13:48:48 +00:00
Richard Davey
40689d1e35 Updated jsdocs. 2018-02-07 15:27:21 +00:00
Felipe Alfonso
b48c2a8173 Fixed scale issue with baseScale of camera manager 2018-01-31 21:52:48 -03:00
Felipe Alfonso
e5831138a4 baseScale added to camera manager and propagated to cameras through preRender function 2018-01-31 21:01:27 -03:00
Richard Davey
2a86400a28 Added in jsdocs 2018-01-31 13:54:44 +00:00
Richard Davey
bc2263dbd4 Fixed Camera3D Plugin, exposed it via camera3d in a Scene and added cameras to local array.
Closes #3188
2018-01-30 13:15:50 +00:00
Michael Hadley
d088889c02 Added resetFX to 2D camera 2018-01-28 11:06:37 -06:00
Richard Davey
12b59ea39d Added jsdocs 2018-01-25 05:11:52 +00:00
Richard Davey
118c69f40f Added jsdocs 2018-01-25 04:41:36 +00:00
Richard Davey
bfddb09bf9 Updated docs and implemented destroy 2018-01-25 03:38:23 +00:00
Richard Davey
2deb9edc9e Plugins now check to see if the Scene is already booted and adapt accordingly. 2018-01-18 14:00:31 +00:00
Richard Davey
5a333bc2fd Updated to new Plugin format, removed injection and mapping 2018-01-18 05:18:09 +00:00
Richard Davey
80fd5d9845 Moved camera controls to their own namespace 2018-01-18 00:08:38 +00:00
Richard Davey
8e07320596 Migrating to plugins 2018-01-16 19:49:13 +00:00
Richard Davey
be756ed7fc Renamed folder camera to cameras and split up the contents into proper namespaces. Merged inc files back into classes. 2018-01-16 15:07:04 +00:00