Commit graph

244 commits

Author SHA1 Message Date
Richard Davey
3504819b33 The CameraManager would incorrectly destroy the default Camera in its shutdown method, meaning that if you used a fixed mask camera and stopped then resumed a Scene, the masks would stop working. The default camera is now destroyed only in the destroy method. Fix #4520 2019-05-17 13:54:55 +01:00
Richard Davey
c91ed91ce3 License link update 2019-05-10 16:15:04 +01:00
Richard Davey
a6341a97a8 Fixed Types references 2019-05-09 15:32:53 +01:00
Richard Davey
dc3b3ecb03 Display Types 2019-05-09 11:53:08 +01:00
Richard Davey
e556cd9c68 Camera Types 2019-05-09 11:49:44 +01:00
Richard Davey
40b325accf A Camera will pause following a Game Object for the duration of the Camera Pan Effect, as the two will clash over the Camera scroll position 2019-05-02 10:51:46 +01:00
Richard Davey
61011d3ae9 Camera.clearRenderToTexture will check to see if the Scene is available before proceeding, avoiding potential errors when a Camera is destroyed multiple times during a Scene shutdown. 2019-04-24 11:46:31 +01:00
Richard Davey
a824f6f1e8 Added a default camera 2019-04-11 17:10:12 +01:00
Richard Davey
79409f0479 You can now add a geometry or bitmap mask to any Camera 2019-04-11 17:09:53 +01:00
Richard Davey
c188dfde12 Testing mask component on Camera 2019-04-10 18:10:03 +01:00
Richard Davey
f4a68404fc lint fix 2019-04-08 11:01:21 +01:00
Richard Davey
ddd1cec3da
Merge pull request #4326 from snowbillr/patch-1
2d Camera startFollow should respect useBounds
2019-04-08 10:57:59 +01:00
Bill Reed
1293e427dd
Use correct values in clamp calls. 2019-04-05 16:50:51 -04:00
bdaenen
35b1beb6a7 Fixes #3833 2019-03-31 15:16:05 +02:00
Jason Nicholls
b3f847d09b Merge remote-tracking branch 'upstream/master' 2019-03-10 13:47:29 +02:00
Bill Reed
22f14ed6dc
fix bug where scrollX and scrollY wouldn't be set 2019-03-09 13:34:07 -05:00
Richard Davey
31b14156de Fixed event name 2019-02-13 16:55:52 +00:00
Richard Davey
fd629fe783 Adding callback typedefs 2019-02-13 16:32:27 +00:00
Richard Davey
e7b1d086e7 Moving all of the typedefs to properly namespaced scopes, rather than globals
\o/ ~ "Someone, save me!"
2019-02-13 12:35:12 +00:00
Richard Davey
ccaae460a4 Added jsdoc version numbers to each event 2019-02-12 11:37:58 +00:00
Richard Davey
d04232ae54 JSDoc fixes 2019-02-04 11:45:17 +00:00
Richard Davey
4f6f6ee72f Lots of jsdoc and type fixes 2019-01-31 12:19:01 +00:00
Richard Davey
3080286a30 Tidying up 2019-01-29 17:19:51 +00:00
Bill Reed
0c12d836a2
2d Camera startFollow should respect useBounds
It was possible for the 2d camera's `startFollow` method to set the `scrollX` and `scrollY` values out of the camera's bounds, even when `useBounds` was set to true.

This PR ensures that `useBounds` is respected by the `startFollow` method when setting the `scrollX` and `scrollY` values. 

Question - should this check also happen when setting the `midpoint` with the `fx` and `fy` values?
2019-01-27 16:01:34 -05:00
Richard Davey
a7b3c95e30 Removed resolution 2019-01-22 14:46:43 +00:00
Richard Davey
5ef7d18ead Merged itrs to single call 2019-01-22 14:46:17 +00:00
Richard Davey
36d86abd48 Added Camera Fade and Game Object Destroy events. 2019-01-18 14:21:45 +00:00
Richard Davey
bc962c25dc All listeners use the new Events 2019-01-18 13:41:43 +00:00
Richard Davey
e6b74304b5 Added Camera pre and post render events. 2019-01-17 12:02:14 +00:00
Richard Davey
c29c8c65b4 Added all Camera events 2019-01-15 23:36:52 +00:00
Richard Davey
aa341854c7 Happy New Year 2019-01-15 16:20:22 +00:00
Richard Davey
a9ddf46134 Update BaseCamera.js
* `BaseCamera.config` has been removed as it's no longer required.
* `BaseCamera.scaleManager` is a new property that references the Scale Manager and is used internally for size checks.
2019-01-11 16:45:25 +00:00
Richard Davey
49c2868746 All default width/height values are now taken from the Scale Manager, not the Game Config 2019-01-11 15:57:57 +00:00
Richard Davey
f6fd6b9f1d Removed baseScale as not needed. 2019-01-10 13:41:24 +00:00
Richard Davey
99b5cf90dc Cameras now factor in the resolution to their transforms 2019-01-10 13:41:07 +00:00
Richard Davey
6d80772faf Get resolution from correct place 2019-01-10 00:15:29 +00:00
iam13islucky
c98f7b7363
Typo - Zoom.js Pan.js Camera.js docs refer to wrong effects 2019-01-06 14:04:38 -07:00
Jason Nicholls
57a1326b84
Merge pull request #1 from photonstorm/master
update with base
2018-12-23 09:17:19 +02:00
Richard Davey
6f8759c186 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. 2018-11-30 10:27:25 +00:00
Richard Davey
171191e1d8 Added Camera centerOnX and centerOnY methods. 2018-11-28 13:24:29 +00:00
Richard Davey
74798cf206 Typo 2018-11-28 08:41:03 +00:00
Richard Davey
30972f4528 Camera.getBounds is a new method that will return a rectangle containing the bounds of the camera. 2018-11-27 17:16:03 +00:00
Jason
ada7fbc990 Added RotateTo Effect to Camera 2018-11-11 18:33:30 +02:00
samme
0e10d50bd8 Revise descriptions for BaseCamera centerX, centerY 2018-10-27 10:30:52 -07:00
Richard Davey
8e04ce5b14 Typos 2018-10-26 19:38:13 +01:00
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