Commit graph

65 commits

Author SHA1 Message Date
Richard Davey
1f8276ac76 Updated copyright year, company and author 2024-02-19 17:12:24 +00:00
Richard Davey
5dc286268f A new property is available in the Game Configuration specifically for setting the 'snap' values for the Scale Manager. You can now set snap: { width, height } in the game config. This is then passed to the display size by the Scale Manager and used to control the snap values. Fix #6629 (thanks @musjj @samme) 2024-02-19 16:35:42 +00:00
Richard Davey
91b2b0c531 lint fix 2024-01-23 00:46:53 +00:00
Richard Davey
2c4df2488b Update SCALE_MODE_CONST.js 2024-01-12 18:08:42 +00:00
Rex
3b8d019b97 Add EXPAND scale mode 2023-12-31 17:11:38 +08:00
Richard Davey
962ff04538 If you gave the width or height in the Game Config object as a string it would multiply the value given by the parent size, often leading to a huge game canvas, or causing WebGL errors as it tried to create a texture larger than the GPU could handle. This has now been strengthened. If you give a string with a % at the end, it works as before, i.e. "100%" or "50%" to set the scale based on the parent. If you don't include the %, or use another unit, such as "800px" it will now be treated as a fixed value, not a percentage. 2023-09-07 15:19:57 +01:00
Richard Davey
468bf7821d Updated copyright year 2023-01-02 17:36:27 +00:00
Richard Davey
4c0ad6946d ScaleManager.listeners has been renamed to domlisteners to avoid conflicting with the EventEmitter listeners object. Fix #6260 2022-10-26 15:08:52 +01:00
Richard Davey
b2d47b11c1
Merge pull request #6214 from rexrainbow/getviewport-with-camera
Get viewport under a camera
2022-09-29 14:40:08 +01:00
Richard Davey
023343c789 All events have a type of string. Fix #6136 2022-09-21 22:01:03 +01:00
Rex
05d4d87b2c Get viewport under a camera 2022-09-08 09:52:18 +08:00
Richard Davey
01c7aab8c0 Fixed version number 2022-06-09 12:11:24 +01:00
Richard Davey
59fbcc5ca3 Updated copyright year 2022-02-28 14:29:51 +00:00
Richard Davey
27833cafc7 Fixed else block 2021-10-25 21:15:53 +01:00
Richard Davey
43ed170cd7 ScaleManager.getParentBounds will now also check to see if the canvas bounds have changed x or y position, and if so return true, causing the Scale Manager to refresh all of its internal cached values. This fixes an issue where the canvas may have changed position on the page, but not its width or height, so a refresh wasn't triggered. Fix #5884 2021-10-25 18:25:24 +01:00
Rex
3246dc4d8e Add method to get visible area 2021-06-12 13:27:22 +08:00
Richard Davey
607fb6ff7c Make docs crystal clear 2020-12-07 12:25:57 +00:00
Richard Davey
02c34cd64e Replace integer with number 2020-11-23 10:22:13 +00:00
Richard Davey
b733dbcbe1 The ScaleManager.resolution property has been removed and all internal use of it. 2020-09-12 11:59:30 +01:00
Richard Davey
68946f3894 The Phaser.Scale.Events#RESIZE event no longer sends the resolution as a parameter. 2020-09-12 11:58:50 +01:00
Richard Davey
60e311afe5 Updated JSDocs 2020-09-11 15:16:37 +01:00
Richard Davey
ce236f0d69 ScaleManager.refresh is now called when the Game.READY event fires. This fixes a bug where the Scale Manager would have the incorrect canvas bounds, because they were calculated before a previous canvas was removed from the DOM. Fix #4905 2020-09-11 12:10:10 +01:00
Richard Davey
380cc422b2 The ScaleManager.updateBounds method is now called every time the browser fires a 'resize' or 'orientationchange' event. This will update the offset of the canvas element Phaser is rendering to, which is responsible for keeping input positions correct. However, if you change the canvas position, or visibility, via any other method (i.e. via an Angular route) you should call the updateBounds method directly, yourself. 2020-08-04 10:35:29 +01:00
samme
02f6c51ff5
Docs: protect ScaleManager#onFullScreenChange
#5229
2020-07-22 11:22:43 -07:00
samme
ee284c6a42 Remove fullscreen promise, handle in onFullScreenChange() instead
Lets Safari start fullscreen (#5143)
2020-05-14 08:43:32 -07:00
Richard Davey
6a93f9e746
Merge pull request #5043 from samme/fix/setGameSize-aspect
Fix wrong display aspect ratio after setGameSize()
2020-04-27 12:21:54 +01:00
Survesh
ed0e76cdbf Updated fix for issue #5069 2020-04-03 18:48:49 +05:30
samme
b61edd088e Update display aspect ratio in setGameSize()
Fixes #4971
2020-03-13 16:49:11 -07:00
Richard Davey
ff65e69cd1 Changed copyright date to 2020 2020-01-15 12:07:09 +00:00
Richard Davey
fdbd5a4f6d The ScaleManager.destroy method wasn't being called when the Game DESTROY event was dispatched, causing minor gc to build up. The destroy method will now be called properly on game destruction. Fix #4944 2020-01-13 12:20:24 +00:00
Adam Beswick
cf4a4e2107 Remove requestedFullscreenChange and replace with checking the document's fullscreen element 2019-12-30 10:34:43 +00:00
Josh Soref
0526276e68 spelling: in case 2019-10-29 02:21:46 -04:00
Richard Davey
ce6a0c1d76 ScaleManager.startFullscreen now checks to see if the call returns a Promise, rather than checking if the browser supports them, before waiting for promise resolution. This fixes a runtime console warning in Microsoft Edge. Fix #4795 2019-10-11 13:53:21 +01:00
Arne Keller
c77bc8d66c
Updated scaleManager.js Docs
Use SCALE_MODE `NONE` instead of `NO_SCALE` in the docs
2019-10-07 12:23:24 +02:00
Richard Davey
bf3a424dfd It was not possible to set the zoom value of the Scale Manager back to 1 again, having changed it to a different value. Fix #4633 2019-08-07 12:47:40 +01:00
Richard Davey
53076e09d1 Update ScaleManager.js 2019-07-15 15:28:31 +01:00
Richard Davey
67b28d6764 The Scale Manager would throw the error 'TypeError: this.removeFullscreenTarget is not a function' when entering full-screen mode. It would still enter fullscreen, but the error would appear in the console. Fix #4605 2019-06-21 10:53:27 +01:00
Richard Davey
6b5b751134 Handle sending previous size to event and updating canvas size in setGameSize. Cleaned-up workflow. 2019-06-06 15:58:23 +01:00
Richard Davey
0a761e104c Added new arguments to RESIZE event 2019-06-06 15:56:26 +01:00
jorbascrumps
648c0faed9 Removed arrow function syntax 2019-05-18 19:15:01 -04:00
Richard Davey
c91ed91ce3 License link update 2019-05-10 16:15:04 +01:00
Richard Davey
725e1d7ef7 JSDoc changes to help TypeScript not get its knickers in a twist 2019-05-09 17:13:25 +01:00
Richard Davey
a6341a97a8 Fixed Types references 2019-05-09 15:32:53 +01:00
Richard Davey
44a63e4d1a Fixed DOM Container centering 2019-04-16 13:10:08 +01:00
Richard Davey
950fc79e2e Took DOM Element out of experimental and hooked to the Scale Manager 2019-04-09 23:28:40 +01:00
Richard Davey
e0f2b829f8 startFullscreen now uses a Promise internally, if it can do so, to resolve and handle the request.
It also tidies up after itself, fires the new 'fail' event and has better documentation.
2019-03-07 12:32:32 +00:00
Richard Davey
046e9801aa Improved docs 2019-03-07 12:31:44 +00:00
Richard Davey
9440412f19 New fullscreen failed event 2019-03-07 12:31:34 +00:00
Richard Davey
c1c03b8464 Improved docs 2019-03-07 12:31:25 +00:00
Richard Davey
a87f275054 The parent bounds are reset when exiting fullscreen mode in the Scale Manager. This fixes an issue when leaving fullscreen mode by pressing ESC (instead of programmatically) would leave the canvas in the full screen size. Fix #4357 2019-02-24 22:12:00 +00:00