Commit graph

12605 commits

Author SHA1 Message Date
Ben Richards
68671f0d8a Create WebGLFramebufferWrapper to encapsulate state. 2024-01-29 14:48:28 +13:00
Ben Richards
b591c3674a Document usage of WebGLTextureWrapper in place of WebGLTexture. 2024-01-29 11:47:39 +13:00
Ben Richards
216b7564f6 Update systems to use WebGLTextureWrapper and Uint8Array textures.
This is mostly hooking up gl calls to look inside the wrapper.
A few other things have changed.
Spector metadata is set the new way.
`Frame` changed `glTexture` to a getter, simplifying bookkeeping.
`LightPipeline` and `Plane` use standard methods to create textures.
`WebGLRenderer` maintains a list of wrappers, and automatically
manages it through `createTexture2D` and `deleteTexture`. The update
methods `updateCanvasTexture` and `updateVideoTexture` have been
delegated to the wrapper.
2024-01-29 11:45:12 +13:00
Ben Richards
a8dff1f990 Add Uint8Array texture creation methods. 2024-01-29 11:30:54 +13:00
Ben Richards
3b2aeaf18b Create WebGLTextureWrapper to encapsulate texture state. 2024-01-29 11:08:16 +13:00
Robert Kowalski
1bfdcfe922 TileSprite textures are now stored in the TextureManager 2024-01-24 19:54:46 -05:00
Robert Kowalski
6ea40f8b32 Text textures are now stored in the TextureManager 2024-01-24 17:25:42 -05:00
Richard Davey
91b2b0c531 lint fix 2024-01-23 00:46:53 +00:00
Richard Davey
95df650f71 The Time.Timeline class didn't show as extending the Event Emitter, or have config as an optional argument in the docs / TS defs. Fix #6673 2024-01-12 18:21:59 +00:00
Richard Davey
786a3933cd Factory.staticBody had the wrong return type in the docs/TS defs. Fix #6693 2024-01-12 18:18:06 +00:00
Richard Davey
2c4df2488b Update SCALE_MODE_CONST.js 2024-01-12 18:08:42 +00:00
Richard Davey
d6d4fc9705
Merge pull request #6703 from rexrainbow/expand-scale-mode
Add EXPAND scale mode
2024-01-12 18:05:39 +00:00
Richard Davey
d137a4782f
Merge pull request #6683 from paxperscientiam/patch-2
Update GetFirst.js
2024-01-12 18:03:57 +00:00
Richard Davey
9febc6b44a Update version number 2024-01-12 18:03:09 +00:00
Richard Davey
e91551b4c5
Merge pull request #6686 from samme/fix/container-destroy-child
Fix removing destroyed Container children
2024-01-12 17:57:57 +00:00
Richard Davey
8cae5a33e7 Update TextureManager.js 2024-01-12 17:56:30 +00:00
Richard Davey
08f340c438
Merge pull request #6670 from stevenwithaph/master
Added correct parameters for create
2024-01-12 17:55:22 +00:00
Richard Davey
9018430e30
Merge pull request #6666 from PresentCreativeLLC/typofix/NineSlice
Update NineSlice.js correcting a typo
2024-01-12 17:51:16 +00:00
Richard Davey
8287d44a04
Merge pull request #6679 from somechris/touch-move-coordinates-on-scrolled-down-page
Fix `InputManager.onTouchMove` to work on scrolled-down pages
2024-01-12 17:48:05 +00:00
Richard Davey
b6c7b51f3d
Merge pull request #6685 from samme/docs/dragend-dropped
Docs: add `dropped` argument in DRAG_END, GAMEOBJECT_DRAG_END
2024-01-12 17:46:38 +00:00
Richard Davey
74515f6437 The TweenChainBuilder was incorrectly setting the persist flag on the Chain to true, which goes against what the documentation says. It now correctly sets it to false. This means if you previously had a Tween Chain that was persisting, it will no longer do so, so add the property to regain the feature. 2024-01-12 17:43:51 +00:00
Rex
3b8d019b97 Add EXPAND scale mode 2023-12-31 17:11:38 +08:00
samme
7b648c64d2 Docs: add dropped arg in DRAG_END 2023-12-04 14:57:45 -08:00
samme
5cd5cadf79 Fix removing destroyed Container child 2023-12-03 16:14:46 -08:00
Chris
c048c1bb54
Update GetFirst.js
Improve type accuracy for GetFirst
2023-12-02 15:38:05 -05:00
Christian Aistleitner
66901b32d3 Fix InputManager.onTouchMove to work on scrolled-down pages
`document.elementFromPoint` expects plain viewport coordinates [1],
while we used `page[XY]`, which are viewport coordinates with added
scroll offsets [2].

So on pages where no scrolling had yet occurred,
`InputManager.onTouchMove` worked as expected. But as soon as one
scrolled down/right on the page, the element detection was off by the
scroll offset.

We switch from `page[XY]` to `client[XY]` which are plain viewport
coordinates [3] and thereby make element detection work also on pages
that have been scrolled around.

[1] https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint
[2] https://w3c.github.io/touch-events/#dom-touch-pagex
[3] https://w3c.github.io/touch-events/#dom-touch-clientx
2023-11-24 14:12:20 +01:00
Steven Adams
6a28ccbee1 Added correct parameters for create 2023-11-14 08:38:05 -05:00
Alvaro Estrada
0b22354afd Update NineSlice.js
Fixed the horiztonal typo
2023-11-10 13:43:50 -06:00
Richard Davey
47d393ac29 Update NineSlice.js 2023-11-10 16:44:16 +00:00
Richard Davey
450c8fcae0 Removed generics that were breaking Layer in TypeScript 2023-11-10 15:27:07 +00:00
Richard Davey
131f73005b eslint fix 2023-11-10 15:04:06 +00:00
Richard Davey
0b32610e56 Updated version to 3.70 2023-11-10 15:04:01 +00:00
Richard Davey
b44b2eda5a Revert "Merged all of the Matter JS "Improved performance and reduced memory usage" changes from PR 1238"
This reverts commit bfd08db935.
2023-11-10 14:58:18 +00:00
Richard Davey
1cae6391b3 Revert "Testing sleep static fixes"
This reverts commit f0d5280cf8.
2023-11-10 14:58:02 +00:00
Richard Davey
988ca7d2bf Updated docs re: #6574 2023-11-10 14:49:36 +00:00
Richard Davey
f0d5280cf8 Testing sleep static fixes 2023-11-10 13:44:47 +00:00
Richard Davey
bd67ed38a5 Disable roundPixels when drawing lines 2023-11-09 22:30:53 +00:00
Richard Davey
bfd08db935 Merged all of the Matter JS "Improved performance and reduced memory usage" changes from PR 1238 2023-11-09 22:12:12 +00:00
Richard Davey
1b93e66cb1 Updates to support the new scale9 Frame data
* You can now create a `NineSlice` Game Object without specifying a width or height for it. If you do this, it will use the size of the texture frame instead.
* The `NineSlice` Game Object will now check to see if its associated Frame has any scale9 data set, and if so this is now used automatically to populate all of the border values.
* The `NineSlice.setSlices` method has a new optional boolean parameter `skipScale9` which will allow you to set the border values of the Nine Slice directly, even if its Frame has associated scale9 data
2023-11-09 18:26:37 +00:00
Richard Davey
dada2ad181 Now parses Texture Packer 7.1.0 scale9 data and stores it on the Frames 2023-11-09 18:23:44 +00:00
Richard Davey
921ff93ba0 Added setScale9 method and scale9 and is3Slice boolean properties
* `Frame.setScale9` is a new method that allows you to set the scale9 data associated with the given Frame. This is used internally by the Texture Packer parsers, but can also be called directly.
* `Frame.scale9` is a new read-only boolean property that returns `true` if the Frame has scale9 data associated with it.
* `Frame.is3Slice` is a new read-only boolean property that returns `true` if the Frame has scale9 data associated with it that is 3-slice instead of 9-slice.
2023-11-09 18:23:27 +00:00
Richard Davey
a7d7a7d526 The Game instance will now boot the new SYSTEM_READY event, which indicates that the internal Scene System has been created by the Scene Manager and is ready for use. The Texture Manager now listens for this event in order to create the stamp Image. This fixes an issue where the stamp would throw a run-time error if the game didn't feature a preload function. Fix #6616 2023-11-09 13:42:00 +00:00
Richard Davey
1afb2810bf Expose new system ready event 2023-11-09 13:40:45 +00:00
Richard Davey
4e19417657 Create SYSTEM_READY_EVENT.js 2023-11-09 13:40:39 +00:00
Richard Davey
6f801eeac7 The TextureSource.setFilter method will now check to see if renderer is defined before accessing its gl property. This avoids Phaser crashing if you're in headless mode and set anti-aliasing to false in the game config. Fix #6663 2023-11-08 18:48:36 +00:00
Richard Davey
cda0c04afd There was an issue when loading Normal Maps with Sprite Sheets. Often, if the normal map image completed loading before the sprite sheet, it would cause it to be incorrectly added to the Texture Manager, resulting in broken frames. Now, regardless of the load order, the sprite sheet is added with its normal map correctly together. Fix #6491 2023-11-08 18:40:08 +00:00
Richard Davey
f49a8ee897 The MultiAtlas File Loader didn't prepend the Loader.prefix if set. This now forms part of the key, leading to the correct keys used for the Texture Manager. Fix #6614 2023-11-08 18:05:15 +00:00
Richard Davey
3b190360f1 During Game.runDestroy it will now check for this.domContainer.parentNode before trying to remove it, preventing errors if the DOM Container has already been removed. Fix #6559 2023-11-08 16:49:39 +00:00
Richard Davey
f844e966bc The RandomDataGenerator#weightedPick method will no longer under-sample the first and last elements in the given array, leading to better distribution of results. Fix #6562 2023-11-08 16:44:27 +00:00
Richard Davey
494ea72108 The BaseSound.destroy method will now call BaseSound.stop which will reset the isPlaying and other flags. Fix #6645 2023-11-08 16:26:48 +00:00