Commit graph

13090 commits

Author SHA1 Message Date
Richard Davey
3c29f694ed Removed unused var 2024-09-05 09:46:55 +01:00
Richard Davey
57df739a68 Removed unused imports 2024-09-05 09:45:56 +01:00
Richard Davey
f5b4691166 Fixed illegal use of destructuring. 2024-09-05 09:44:54 +01:00
Richard Davey
dfe3ec3aba Fixed lint errors and lines redeclaration 2024-09-05 09:39:51 +01:00
Richard Davey
45d2d6f939 Tidied up and renamed the new depth ordering functions 2024-09-05 09:37:37 +01:00
Richard Davey
dc714b10bd lint fixes 2024-09-05 09:35:19 +01:00
Richard Davey
b8839e4e70
Merge pull request #6746 from lukas-dachtler/fix/matterJSTypes
fixed MatterJS type definitions
2024-09-03 14:44:05 +01:00
Richard Davey
a88351c643 Update version number 2024-09-03 14:38:19 +01:00
Richard Davey
25f20485a2
Merge pull request #6819 from moufmouf/fix-dom-zoom-origin
Fixing DomElement position when camera zoom != 1
2024-09-03 14:36:59 +01:00
Richard Davey
8091292439 Fix #6854 #6737 (PipelineConfig TS) 2024-09-03 14:35:02 +01:00
Zeke Chan
780def8cf9 Fix #6860 BitmapText not wrapping lines in some cases 2024-09-03 15:52:10 +08:00
Richard Davey
c308c430c3
The NineSlice Game Object will now guard against an invalid texture by checking for the frame and textureFrame vars before trying to read values from them. Fix #6804 2024-09-02 22:40:41 +01:00
Richard Davey
fcd0f7180c
The Mesh WebGLRenderer will now recalculate the vertexOffset correctly if the batch flushes, fixing an issue where it would display missing triangles in a mesh after a batch flush. Fix #6814 2024-09-02 22:34:29 +01:00
Richard Davey
98ea091edc
Video.getFirstFrame is a new method that can be used to load the first frame of the Video into its texture without starting playback. This is useful if you want to display the first frame of a video behind a 'Play' button, without calling the 'play' method. Fix #6695 2024-09-02 22:02:55 +01:00
Richard Davey
85d64d77a4
Removed incorrect docs. Fix #6760 2024-09-02 21:20:41 +01:00
Richard Davey
5cc02afbd4 Update Config.js 2024-09-02 18:58:30 +01:00
Richard Davey
ee426c9ae4 If you set a WebAudioSound to loop and set SoundManager.pauseOnBlur = false, then if you start the sound and tab away from Phaser, the sound wouldn't then loop on return to the game, if the loop _expired_ while the tab was out of focus. This was due to checking the audio source node target against the wrong internal property. Fix #6702 2024-09-02 18:27:10 +01:00
Richard Davey
513e8b5429 Update RenderConfig.js 2024-09-02 16:10:24 +01:00
Richard Davey
1e07586acc Fixed method names 2024-09-02 16:07:34 +01:00
Richard Davey
6170a21938 Remove use of PipelineConfig 2024-09-02 16:05:50 +01:00
zekechan
57db2cbe03 Update ScaleManager.js 2024-09-02 22:31:01 +08:00
Richard Davey
04f54b888a Fix getScene return type. Fix #6821 2024-09-02 14:26:00 +01:00
Richard Davey
9eaf661a45 Added prerenderclear event to canvas and webgl 2024-09-02 14:18:32 +01:00
Luca Fagioli
0cf92cba50
Update TextStyle.js 2024-09-02 11:06:01 +02:00
Zeke Chan
9f3afafb29 Fix #6885 leave fullscreen event fires twice 2024-09-02 13:58:15 +08:00
Richard Davey
c86b5b2528 Make Layer extend event emitter in the docs 2024-08-29 14:05:17 +01:00
Richard Davey
378838a011
All functions now call 'queueOp'.
Removed sound unlocking on load complete.
2024-08-25 22:35:39 +01:00
Richard Davey
53c491fb84
You can now pass a data argument to ScenePlugin.switch 2024-08-25 22:34:15 +01:00
Richard Davey
4003aa7f3e
Merge branch 'master' of https://github.com/phaserjs/phaser 2024-08-25 21:53:51 +01:00
Richard Davey
59ce761140
Calling Matter.World.pause would stop the world updating, but the Runner timeLastTick wasn't reset when resume was called, causing all the bodies to advance. The time is now reset correctly. Fix #6892 2024-08-25 21:53:37 +01:00
Richard Davey
683ae16522
Merge pull request #6890 from ospira/process-callback-fix
Allow ProcessCallback To Work When Dealing With Arcade Bodies That Do Not Have GameObjects
2024-08-25 21:29:03 +01:00
Richard Davey
ec753ae195
Merge pull request #6895 from Andrek25/fix/typos
fix(typedefs): fixing some typo error
2024-08-25 21:26:46 +01:00
samme
7fd11d2e98 Docs: clarify moveAbove(), moveBelow() 2024-08-23 08:50:47 -07:00
Andres
8b24e73d3d fix(typedefs): fixing some typo error 2024-08-22 21:49:51 -04:00
ospira
fbfe657698 Update ArcadePhysicsCallback.js 2024-08-13 12:40:37 -04:00
ospira
b99ac68c34 Update ArcadePhysicsCallback.js 2024-08-13 12:29:10 -04:00
ospira
e321be2130 Update World.js 2024-08-13 11:56:38 -04:00
Richard Davey
48f3769e55
Update ArcadeColliderType.js 2024-08-12 17:09:06 +01:00
Richard Davey
a77976bff2 * InputPlugin.forceDownState is a new method that will force the given Game Object into the 'down' input state, regardless of what state it is currently in. This will emit the relevant events accordingly. * InputPlugin.forceUpState is a new method that will force the given Game Object into the 'up' input state, regardless of what state it is currently in. This will emit the relevant events accordingly. * InputPlugin.forceOverState is a new method that will force the given Game Object into the 'over' input state, regardless of what state it is currently in. This will emit the relevant events accordingly. * InputPlugin.forceOutState is a new method that will force the given Game Object into the 'out' input state, regardless of what state it is currently in. This will emit the relevant events accordingly. * InputPlugin.forceState is a new internal method that forces a Game Object into the given state. 2024-08-07 19:45:44 +01:00
Richard Davey
6102492c14 InputPlugin.setCursor is a new method that will immediately set the CSS cursor to the given Interactive Objects cursor. Previously, this was hidden behind a private method in the Input Manager. 2024-08-07 19:14:54 +01:00
Richard Davey
a5d465cb19 Multiple updates. See description.
The `InputPlugin.isActive` method will now check if the InputPlugin has the InputManager reference set, and if that is also enabled, as well as checking its own enabled state and that of the Scene.

`InputPlugin.resetCursor` is a new method that will reset a custom CSS cursor from the main canvas, regardless of the interactive state of any Game Objects.

The `InputPlugin.disable` method has a new optional boolean parameter `resetCursor` which will reset the CSS custom cursor if true.

All of the core Input Plugin process methods have been rewritten. The methods that have changed are:

* `InputPlugin.processMoveEvents`
* `InputPlugin.processWheelEvent`
* `InputPlugin.processOverEvents`
* `InputPlugin.processOutEvents`
* `InputPlugin.processOverOutEvents`
* `InputPlugin.processUpEvents`
* `InputPlugin.processDownEvents`

And they all now do the following flow:

1) They will now iterate over the array of objects to be inspected. If the object doesn't have an input handler, or their handler has been disabled, they are skipped for event consideration.
2) If they have an input handler, the Game Object specific event is dispatched (i.e. `sprite.on('pointerdown')`)
3) The result of this call is checked. If the Event has been cancelled, or if the Input Plugin now returns `isActive() false` then it will break from the handler loop. This will only happen if the user explicitly tells the event to stop propogation, or if they disable either the Input Plugin, or the entire Input Manager, during the event handler. Previously, only the state of cancelled event was checked. Also previously, if the Game Objects own input handler was removed or disabled as a result of their event handler, it would break from the process loop. This no longer happens. It will carry on inspecting the remaining interactive objects in the loop, as long as the Input system itself wasn't disabled.
4) After this, the Game Object is checked to see if it is still input enabled. If it is, the Scene level events, like `this.input.on('gameobjectdown')` are emitted.
5) The results of this call are also checked. Again, if the Event has been cancelled, or if the Input Plugin now returns `isActive() false` then it will break from the handler loop, otherwise it carries on.
6) After the loop is complete it does one final check to see if the Event was cancelled, or if the Input Plugin is no longer active. If both of those pass, it emits the final event from the Input Plugin itself (i.e. `this.input.on('pointerdown')` from a Scene)
2024-08-07 19:00:05 +01:00
Richard Davey
2a05c49d9e The InputManager.resetCursor method has a new optional boolean forceReset which will reset the state of the CSS canvas cursor, regardless if there is a given Interactive Object, or not. 2024-08-07 18:36:54 +01:00
Richard Davey
5b972ae38a Added resetCursor boolean to disableInteractive and removeInteractive methods 2024-08-07 18:36:02 +01:00
Richard Davey
8abcd2a610 Clarify documentation. Fix #6839 2024-08-07 15:48:56 +01:00
Richard Davey
7fd6b6fdf8 LoaderPlugin.maxRetries is a new property that holds the number of times to retry loading a single file before it fails. 2024-08-07 15:43:43 +01:00
Richard Davey
ca4e2da432 loader.maxRetries is a new Game Config option to set the number of retries a file will attempt to load. The default is 2. 2024-08-07 15:43:25 +01:00
Richard Davey
4021fa50fa FileConfig.maxRetries is a new File Config option to set the number of retries a file will attempt to load. If not specified in the config, the value is read from the LoaderPlugin.maxRetries property. 2024-08-07 15:43:11 +01:00
Richard Davey
0a7df76c3f Loader.File.retryAttempts is the internal property holding the counter for the number of times to retry loading this file before it fails. This value is decreased after each attempt. When it reaches zero, the file is considered as failed. 2024-08-07 15:42:57 +01:00
Richard Davey
13035a6718
If you had a sprite on the display list using the LightPipeline, followed by a Mesh using the LightPipeline, and you invalidated the mesh (i.e. by rotating it), it would cause a runtime error in the current batch. Fix #6822 2024-08-06 23:59:42 +01:00
Richard Davey
f434449dd8
The PreFXPipeline.batchQuad method will now apply Math.round to the target bounds center point. This prevents sub-pixel values during the copyTextSubImage2D call, preventing sprites with pre-fx from appearing mis-aligned during camera pans. Fix #6879 2024-08-06 23:27:34 +01:00
Richard Davey
6acd415d16
Don't round the midPoint, or it breaks high zoom scrolling. Fix #6878 2024-08-06 23:01:33 +01:00
Richard Davey
5aaa5ec601
Merge branch 'master' of https://github.com/phaserjs/phaser 2024-08-06 22:48:54 +01:00
Richard Davey
24125ef4d9
Update Config.js 2024-08-06 22:48:49 +01:00
Richard Davey
8ef75453d0
Merge pull request #6876 from wooseok123/wooseok123-feat-switch
feat : add data argument in Scene.switch
2024-08-06 21:57:28 +01:00
Richard Davey
1624312aea
Merge pull request #6883 from RomanFrom710/6880-text-with-stroke-and-letter-spacing-issue
Apply stroke letter by letter if there is custom letter spacing
2024-08-06 21:54:21 +01:00
Richard Davey
50196f4958 Disable autoResize flag. The size a DynamicTexture is created at is the size it should remain forever. 2024-08-06 18:58:31 +01:00
Richard Davey
c81c6cecc8 Remove the requirement for autoResize to be set, so anyone can resize a RenderTarget 2024-08-06 18:58:12 +01:00
Richard Davey
d4d6a4c308 Beta 3 tag 2024-08-06 18:41:11 +01:00
Roman Chaley
cdefe1f68c
Apply stroke letter by letter if there is custom letter spacing 2024-08-04 16:11:37 +02:00
zekechan
cc0bac0214 Removed empty line spacing added when text is undefined. Fix #6807 2024-07-30 13:40:53 +08:00
Richard Davey
a3470a08e5
Updated rounding to use Math.floor + 0.5 2024-07-28 14:56:53 +01:00
Wooseok Han
8a52c00cad
feat : add data argument in Scene.switch 2024-07-26 13:25:07 +09:00
Richard Davey
f519c582c7 Fixed jsdocs 2024-07-23 16:58:57 +01:00
Richard Davey
49456a08b8
Merge pull request #6870 from samme/feature/timestep-pauseDuration-2
Pass pauseDuration 0 in `Phaser.Core.Events#RESUME` after manual game resume
2024-07-23 16:53:01 +01:00
Richard Davey
412d0e5b71
Merge pull request #6869 from samme/docs/scene-events
Docs: correct args in some scene events
2024-07-23 16:52:33 +01:00
Richard Davey
abf857d949 The Texture.getFrameBounds method will now include the BASE texture in its calculations. This prevents it from returning a size of Infinity. This fixes an issue where a Tileset with margin/spacing loaded via load.spritesheet instead of load.image would have its margin and spacing ignored. Fix #6823 2024-07-23 16:39:49 +01:00
Richard Davey
ee2110c062 Removed debugging info. 2024-07-23 16:38:07 +01:00
Richard Davey
0d32e7bcbc Fixed jsdoc 2024-07-23 15:48:54 +01:00
Zeke Chan
994389d041
Merge pull request #6816 from jacklehamster/master
Add PR to fix null pointer exception.
2024-07-23 16:52:37 +08:00
Zeke Chan
54e555d56a Revert "#6816 Phaser.GameObjects.Components.FX#add fix null pipeline pointer"
This reverts commit 389e2af60f.
2024-07-23 16:51:45 +08:00
Zeke Chan
389e2af60f #6816 Phaser.GameObjects.Components.FX#add fix null pipeline pointer 2024-07-23 16:50:00 +08:00
Richard Davey
6c02206a90 Debugging tile spacing 2024-07-22 19:03:57 +01:00
Richard Davey
52085dba91 Don't call setTileSize or setSpacing unless values are given 2024-07-22 19:03:11 +01:00
samme
96bae29e62 Pass pauseDuration 0 for manual resume 2024-07-21 07:36:24 -07:00
Richard Davey
dc27d377f2 Include version in gameURL 2024-07-19 17:01:30 +01:00
Zeke Chan
5d74999620 Fixed "undefined" style bug causing crashes 2024-07-19 11:06:23 +08:00
samme
a98f1f5713 Docs: correct args in some scene events 2024-07-18 19:03:08 -07:00
Richard Davey
99260d2174
DynamicTexture now creates a Camera instance, not a BaseCamera 2024-07-18 21:21:33 +01:00
Richard Davey
14429786a0
Merge pull request #6867 from samme/feature/timestep-pauseDuration
Add TimeStep#pauseDuration, pass in Phaser.Core.Events#RESUME
2024-07-18 20:34:57 +01:00
samme
2824185784 Add TimeStep#pauseDuration
Pass in Phaser.Core.Events#RESUME
2024-07-17 18:57:03 -07:00
zekechan
4332448e9f Moved errors description above @ignore tag 2024-07-17 23:32:12 +08:00
zekechan
3658cd145f Updated default location property from literal -1 to type number 2024-07-17 23:31:48 +08:00
zekechan
5ddd3bf8a2 Removed duplicate localScheme property 2024-07-17 23:30:53 +08:00
zekechan
f218a1bca2 Fix #6768 Tweens in a looping chain fire onStart only once 2024-07-17 15:35:06 +08:00
zekechan
112ca0dbf1 Fix #6773 Tweens in a chain fire onActive twice per chain iteration 2024-07-17 10:55:58 +08:00
Richard Davey
26d85978d2
Apply Math.floor across all camera values during preRender 2024-07-16 23:18:31 +01:00
Richard Davey
2fc8f5b3f9
Floor, not round 2024-07-16 23:17:40 +01:00
Richard Davey
40224d7c25
Removed BaseCamera.preRender method as it isn't used (overriden by Camera.preRender) 2024-07-16 22:59:47 +01:00
Richard Davey
d12b51cb48
The Multi Pipeline batchSprite and batchTexture methods will now apply Math.floor to the sprite matrix calculations if camera round pixels is enabled. 2024-07-16 22:59:22 +01:00
Richard Davey
ccf09b3019
roundPixels now defaults to false again 2024-07-16 21:24:43 +01:00
Richard Davey
77f209bbe5
Removed the uRoundPixels shader uniform and from the pipelines. Pass camera.roundPixels to setQuad. 2024-07-16 21:24:16 +01:00
Richard Davey
160587fb2d
Inlined the BitmapText BatchChar math to avoid 16 function calls per character 2024-07-16 21:23:09 +01:00
Richard Davey
f2855c66dd
Merge branch 'master' of https://github.com/phaserjs/phaser 2024-07-16 20:25:28 +01:00
Richard Davey
a8724b88d8
Calling Ellipse.setSize will internally call updateDisplayOrigin to retain position 2024-07-16 20:25:26 +01:00
Zeke Chan
23e287ef0e #6773 Fixed TweenChain fire onActive twice per chain iteration 2024-07-16 17:42:10 +08:00
Zeke Chan
f8dc6dcadb
Merge pull request #6782 from rexrainbow/depth-helper
Add some helper methods for changing rendering order
2024-07-16 16:29:45 +08:00
Zeke Chan
930d1ebcb6 Added missing var in for loop 2024-07-16 16:21:26 +08:00
Zeke Chan
340f90a627
Merge pull request #6793 from samme/feature/remove-asset-pack
Add Phaser.Loader.LoaderPlugin#removePack
2024-07-16 16:17:53 +08:00
Zeke Chan
71684df68e
Merge pull request #6802 from samme/feature/timeline-timeScale
Add Phaser.Time.Timeline#timeScale
2024-07-16 15:56:34 +08:00
Richard Davey
77bbab31f1 The RenderTarget will now automatically listen for the Renderer resize event if autoResize is true. This fixes an issue with Bitmap Masks where they wouldn't resize if the renderer resized. Fix #6769 2024-07-15 18:34:22 +01:00
Richard Davey
5038c26051 The TextStyle.setStyle method will no longer mutate the given style object if it includes a numeric fontSize value. Fix #6863 2024-07-15 17:44:39 +01:00
Richard Davey
b14c580282 typo 2024-07-15 17:26:16 +01:00
Richard Davey
f2cc3c0b91 Update TilemapLayer.js 2024-07-15 17:24:27 +01:00
zekechan
944c6be993 BitmapText with maxWidth set does not wrap text correctly when a line ends with a white space. Fix #6860 2024-07-15 17:12:50 +08:00
Richard Davey
5f4dfa4fb8 Fixed call to lengthSq 2024-07-12 16:58:51 +01:00
Richard Davey
29426d198e Updated lookAtRH to call Vec3.lengthSq 2024-07-12 16:56:17 +01:00
Richard Davey
0560a787c5 Added missing subVectors method 2024-07-12 16:56:17 +01:00
Zeke Chan
7931e181a2 Updated maxWidth calculations 2024-07-12 15:34:48 +08:00
Zeke Chan
e9f92fab64 Revert "Updated maxWidth calculations"
This reverts commit 514f99d8aa.
2024-07-12 12:37:42 +08:00
Zeke Chan
514f99d8aa Updated maxWidth calculations 2024-07-12 12:27:13 +08:00
Zeke Chan
9ecd99d173 Corrected currentLine offset 2024-07-11 17:34:47 +08:00
Zeke Chan
6fd0769915 Fixed line wrapping issue for lines ending with a space 2024-07-11 17:00:53 +08:00
zekechan
a190054ce0 Update TileSprite.js
Default width and height are assigned to displayFrame separately.
2024-07-10 17:15:57 +08:00
Zeke Chan
a51e91e066
Merge pull request #6850 from rexrainbow/bugfix-drag
Fix drag-with-multiple-camera bug
2024-07-10 16:47:26 +08:00
Zeke Chan
7a726560ee
Merge pull request #6849 from samme/docs/tilemaps-nonNull
Docs: `nonNull` argument for `GetTileAt()` etc.
2024-07-10 16:44:12 +08:00
Rex
464dae5c96 Use cloned drag pointers
Drag pointer might be removed under event, it will break processing loop of drag pointers #6820
2024-07-10 10:22:03 +08:00
Zeke Chan
b2f6922c20 Changed group.length to group.getLength() 2024-07-05 15:25:14 +08:00
Zeke Chan
3bb1f6f96a Changed default collisionMask = 2147483647 2024-07-05 15:24:58 +08:00
Zeke Chan
547179c5b8 Changed default collisionMask = 2147483647 2024-07-05 15:24:51 +08:00
Zeke Chan
5e7a8aeb01 Update RenderTarget.js 2024-07-05 14:31:06 +08:00
Zeke Chan
7450ff9dff Add null support to ignore default, missing, and white base64 images in TextureManager 2024-07-04 15:24:39 +08:00
Zeke Chan
97455bcedd Added clear area functionality 2024-07-04 14:56:11 +08:00
Zeke Chan
49c32ba5c5 Added clear area functionality 2024-07-04 14:56:06 +08:00
Zeke Chan
02519c2ee5 Updated internal update method to MatterJS 0.20.0 2024-07-03 15:10:31 +08:00
Zeke Chan
f69411fd6b Integrated MatterCollisionEvents plugin 2024-07-01 17:20:58 +08:00
Zeke Chan
2bd89f1f29 Removed MatterCollisionEvents plugin 2024-07-01 17:20:43 +08:00
Zeke Chan
ea79f2be5c Update MatterPhysics.js 2024-07-01 16:55:07 +08:00
Zeke Chan
431e58aa0f Update Engine.js 2024-07-01 16:54:49 +08:00
Zeke Chan
ad2865f3fb Added attractors property 2024-07-01 16:54:35 +08:00
Zeke Chan
cff438b2f8
Merge pull request #6846 from samme/feature/direct-control-friction
Add friction for direct-control bodies
2024-06-29 14:52:02 +08:00
Rex
05529fc98d Store camera when drag-start 2024-06-29 00:19:48 +08:00
Rex
77c8f7389d Fix drag-with-multiple-camera bug 2024-06-28 23:32:22 +08:00
Zeke Chan
429b794bd1 Update Runner.js 2024-06-28 17:51:33 +08:00
Zeke Chan
a0f44ed02e Added wrapBounds property 2024-06-28 17:32:54 +08:00
Zeke Chan
ea0651f44d Removed MatterCollisionEvents, MatterAttractors, MatterWrap plugins 2024-06-28 17:32:33 +08:00
Zeke Chan
2ec9e38405 Added wrap to bounds feature 2024-06-28 17:31:50 +08:00
Zeke Chan
8667f5dd38 Added wrap to bounds feature 2024-06-28 17:31:41 +08:00
Zeke Chan
a69bacbb5c Added wrap to bounds feature 2024-06-28 17:31:31 +08:00
Zeke Chan
2512f65da0 Added wrap to bounds feature 2024-06-28 17:31:27 +08:00
Zeke Chan
df2e7e7104 Update MatterWorldConfig.js 2024-06-28 16:29:38 +08:00
Zeke Chan
e0aed1aacf Update MatterWorldConfig.js 2024-06-28 15:43:57 +08:00
samme
9037738bce Docs: nonNull arg for GetTileAt() etc. 2024-06-27 14:17:47 -07:00
Zeke Chan
05a814dc1d Update World.js
Updated `pair.activeContacts.length` to use new `pair.contactCount` property
2024-06-27 17:06:44 +08:00
Zeke Chan
0458e4ab01 Update MatterCollisionPair.js
Changed `activeContacts` to `contacts`
2024-06-27 17:05:39 +08:00
samme
b961398acf Add friction for direct-control bodies
Fixes #6792
2024-06-26 09:43:39 -07:00
Zeke Chan
ea48bcf491 Update ParticleEmitter.js 2024-06-26 10:58:39 +08:00
Richard Davey
c45e2f4dba MatterJS v0.20 integration 2024-06-25 18:51:12 +01:00
Richard Davey
91f21c95e9 3.85 beta 2 const 2024-06-25 18:50:55 +01:00
Zeke Chan
f0f82d3a40 Update ParticleEmitter.js 2024-06-25 15:55:55 +08:00
Richard Davey
b49cf68e71 v.3.85.0-beta.1 release 2024-06-21 17:00:46 +01:00