Commit graph

10634 commits

Author SHA1 Message Date
Richard Davey
be2dad8a70
Merge pull request #5292 from browndragon/tiled
Fix up tiled json parsing.
2021-02-16 11:35:24 +00:00
Richard Davey
6b960464b5
Merge pull request #5504 from endel/patch-1
allow to customize pointerEvents for dom elements
2021-02-16 11:29:26 +00:00
Richard Davey
c5766a68a4
Merge pull request #5540 from samme/feature/shape-setDisplaySize
Add Phaser.GameObjects.Shape#setDisplaySize()
2021-02-16 11:18:23 +00:00
Richard Davey
a73b2b31ac
Merge pull request #5546 from xuxucode/patch-1
Fix PlaceOnRectangle JSDoc
2021-02-16 11:14:50 +00:00
Richard Davey
79d7dadac9
Merge pull request #5551 from samme/fix/line-curve-tangent-out
Fix missing output arg in Phaser.Curves.Line#getTangent
2021-02-16 11:11:49 +00:00
Richard Davey
4b3a0009ee
Merge pull request #5559 from mattjennings/fix-5558
Fixes #5558
2021-02-16 10:56:01 +00:00
Richard Davey
a05da72739 DOMElementCSSRenderer will now return early if src.node doesn't exist or is null, rather than trying to extract the style property from it. Fix #5566 2021-02-16 10:48:35 +00:00
samme
e2384f8961 Add min and max zoom to camera controls 2021-02-14 21:07:37 -08:00
Matt Jennings
72fd48abc4 safely check for renderer in TileSprite 2021-02-11 16:00:24 -06:00
Matt Jennings
a29523de53 safely check for renderer in BitmapMask 2021-02-11 15:57:40 -06:00
Matt Jennings
d30c1682d2 check that renderer exists before accessing renderer.type (fixes #5558) 2021-02-11 15:43:16 -06:00
Richard Davey
3493c4cd7b
Merge pull request #5523 from veleek/veleek/tiledobjectprops
Load Tiled object properties using names.
2021-02-10 09:30:56 +00:00
samme
bdca6f28f3 Fix missing out arg in Curves.Line#getTangent 2021-02-09 09:44:06 -08:00
xuxu
c3d3461a38
Fix PlaceOnRectangle JSDoc
The shift value defaults to 0
2021-02-07 21:43:19 +08:00
Richard Davey
dff17f52e8 The LightPipeline now only calls batchSprite, batchTexture and batchTextureFrame if the Scene Lights Manager is active. Fix #5522 2021-02-04 16:38:09 +00:00
Richard Davey
b40010b86b Fixed JSDocs 2021-02-04 16:27:02 +00:00
Richard Davey
aaf51dc7ce The LightsManager.addPointlight method now has full JSDocs and the attenuation parameter. 2021-02-04 16:19:19 +00:00
Richard Davey
79468de255 ESLint fix 2021-02-04 16:11:09 +00:00
Richard Davey
5176fcfacd The Canvas Renderer will no longer run a fillRect if clearBeforeRender is false in the Game Config. 2021-02-04 16:06:47 +00:00
Richard Davey
c5cbb413d2 You can now set the boolean preserveDrawingBuffer in the Game Config (either directly, or in the Render Config). This is passed to the WebGL context during creation and controls if the buffers are automatically cleared each frame or not. The default is to clear them. Set to true to retain them. 2021-02-04 15:58:41 +00:00
Richard Davey
bfbf665676 Merge branch 'master' of https://github.com/photonstorm/phaser 2021-02-04 15:32:43 +00:00
Richard Davey
d1a08da63d Update RenderConfig.js 2021-02-04 15:28:35 +00:00
Richard Davey
895d684c15
Merge pull request #5521 from edemaine/patch-1
Fix setPolygon documentation
2021-02-04 15:20:02 +00:00
Richard Davey
641a7c5d99
Merge pull request #5533 from veleek/veleek/isometricfix
Fix IsometricWorldToTileXY result
2021-02-04 15:17:54 +00:00
Richard Davey
e5f05fa248
Merge pull request #5541 from samme/feature/scene-prerender-event
Add Phaser.Scenes.Events.PRE_RENDER event
2021-02-04 15:04:07 +00:00
Richard Davey
46f127b0af
Merge pull request #5517 from rexrainbow/input-bug
Fix input bug
2021-02-04 14:59:43 +00:00
Richard Davey
01df296304
Merge pull request #5539 from somechris/from-percent-min-fix
Allow non-zero `min` in `FromPercent`
2021-02-04 14:53:41 +00:00
Richard Davey
f727171717
Merge pull request #5543 from samme/feature/warn-invalid-json
Warn and call onProcessError() for invalid JSON
2021-02-04 14:50:43 +00:00
samme
ff1afb4976 Warn and call onProcessError() for invalid JSON
Then rethrow
2021-02-03 11:58:29 -08:00
Richard Davey
a10919391a type fix 2021-02-01 15:17:59 +00:00
Richard Davey
23987112e1 Update WebAudioSound.js
* The `WebAudioSound.audioBuffer` property is no longer private.
* The `WebAudioSound.source` property is no longer private.
* The `WebAudioSound.loopSource` property is no longer private.
* The `WebAudioSound.muteNode` property is no longer private.
* The `WebAudioSound.volumeNode` property is no longer private.
* The `WebAudioSound.pannerNode` property is no longer private.
* The `WebAudioSound.hasEnded` property is no longer private, but _is_ read only.
* The `WebAudioSound.hasLooped` property is no longer private, but _is_ read only.
2021-02-01 15:17:48 +00:00
Richard Davey
c20b06b259 Made most properties public. Fix #5531
* The `WebAudioSoundManager.createAudioContext` method is no longer private.
* The `WebAudioSoundManager.context` property is no longer private.
* The `WebAudioSoundManager.masterMuteNode` property is no longer private.
* The `WebAudioSoundManager.masterVolumeNode` property is no longer private.
* The `WebAudioSoundManager.destination` property is no longer private.
2021-02-01 15:17:37 +00:00
Christian Aistleitner
cbf3957a33 Allow non-zero min in FromPercent
`FromPercent` silently assumed `min` to be 0. Shifting the result by
`min` makes it work as documented and gives a value between `min` and
`max`.

Our uses of `FromPercent` only have `min` at 0, so there is no
regression in our code. This is merely a fix for 3rd party users.
2021-01-31 21:08:46 +01:00
samme
7ba9d7ea8b Docs: update scene event flow (PRE_RENDER) 2021-01-30 11:02:42 -08:00
samme
1145fd41bb Add Phaser.Scenes.Events#PRE_RENDER event
By Phaser.Scenes.Systems#render
2021-01-30 11:02:42 -08:00
samme
a8e05cec3e Add Phaser.GameObjects.Shape#setDisplaySize() 2021-01-30 09:33:21 -08:00
Rex
ee16c63987 Fix parameter name bug 2021-01-29 09:32:45 +08:00
Ben Randall
40ff85bdc5 Fix IsometricWorldToTileXY result
IsometricWorldToTileXY returns a tile that is offset by (-0.5, 0.5)
tiles from the expected location.  This fixes the function so that
Tile => World => Tile conversion returns the same value.
2021-01-28 12:25:51 -05:00
Ben Randall
fea65988f4 Load Tiled object properties.
Tiled objects have properties as an array of objects like:

  { name: ..., type: ..., value: ...}

Update the parser to load these using the name/value properties instead
of just treating it as an array and loading properties named '0', '1',
etc.  This is the same as how properties are handled in ParseTilesets.js
2021-01-23 14:59:33 -05:00
Erik Demaine
3accf46223
Fix setPolygon documentation
The order of arguments in `Body.setPolygon`'s documentation was the opposite from the actual code.
2021-01-22 20:13:25 -05:00
Rex
7f610eef98 Fix input bug 2021-01-21 11:13:33 +08:00
Richard Davey
c9b68c167a Bail out of Device tests if running inside a Web Worker 2021-01-19 09:40:59 +00:00
Richard Davey
e0d22da461 IE9 polyfills are no longer part of the core build 2021-01-19 09:40:30 +00:00
Richard Davey
5e1da21c4d Created new IE9 specific build 2021-01-19 09:40:09 +00:00
Richard Davey
332d9c85cb BlitterWebGLRenderer was calling an out-dated function setRenderDepth instead of addToRenderList 2021-01-14 17:09:04 +00:00
Endel Dreyer
1919bbdfb8
allow to customize pointerEvents for dom elements 2021-01-14 10:54:29 -03:00
Richard Davey
a7498e5994 Preparing for 3.53.0 dev 2021-01-14 11:35:44 +00:00
Richard Davey
9116eddf99 Some Bitmap Text fonts were not rendering under Canvas due to the way in which the texture offset was calculated. It now uses the __BASE frame to get the texture offset, rather than the first frame in the set. Fix #5462 #5501 2021-01-14 11:06:04 +00:00
Richard Davey
b1697f5e09 Merge branch 'master' of https://github.com/photonstorm/phaser 2021-01-14 10:19:38 +00:00
Richard Davey
357a4fc82d AtlasJSONFile, AtlasXMLFile, BitmapFontFile and UnityAtlasFile will now call File.pendingDestroy, clearing up the resources it used during load and emiting a missing FILE_COMPLETE event. Fix #5495 2021-01-14 10:19:24 +00:00
Richard Davey
b9162847bb
Merge pull request #5498 from lackhand/patch-1
Update Mesh.js documentation around panZ
2021-01-14 10:02:12 +00:00
Richard Davey
a5ffb59eb2
Merge pull request #5503 from kainage/banner-url-color
Transparent background for banner gameURL
2021-01-14 09:57:47 +00:00
Richard Davey
5bae5c5eb6
Merge pull request #5499 from lackhand/patch-2
Fix typo in GenerateVerts.js
2021-01-14 09:54:19 +00:00
Richard Davey
d1ece18c93 The method TilemapLayer.weightedRandomize has changed so that the parameter weightedIndexes is now first in the method and is non-optional. Previously, it was the 5th parameter and incorrectly flagged as optional. This change was made to the docs but not the parameters, but now works according to the docs 2021-01-14 09:48:16 +00:00
kainage
1e0bae4e21 Use transparent background for banner gameURL to support different browser color themes 2021-01-13 22:33:05 -08:00
Andrew Cunningham
36b3de1748
Make GenerateVertsResults verts -> vertices
Update typedefs to match the new spelling.
2021-01-13 18:46:07 -05:00
Andrew Cunningham
56fc62a21a
Fix typo in GenerateVerts.js
The result contains `["verts"]`, but the caller expects [`["vertices"]`](d67c93646c/src/gameobjects/mesh/Mesh.js (L705)). Better to expand the field name (IMO).
2021-01-13 18:36:33 -05:00
Andrew Cunningham
724c2f59d5
Update Mesh.js documentation around panZ
This adds warnings about orthographic and perspective cameras, documents setOrtho & panZ with sane (ish) default values for the default projection matrix, and updates the example code in the file.

These changes could go further; I would love it if the default mechanisms "agreed" (so that feeding it z=0 vertex values "just worked"), but that's probably a difficult backwards facing change.

Inspired by https://github.com/photonstorm/phaser/issues/5380 .
2021-01-12 14:28:52 -05:00
Richard Davey
15908ce271 getPostPipeline will now return an array of them all if there is more than one instance 2021-01-11 17:17:00 +00:00
Richard Davey
9ad922f56d Moved renderList to BaseCamera 2021-01-11 09:46:50 +00:00
Richard Davey
1c8662dc1f Call addToRenderList 2021-01-07 14:52:08 +00:00
Richard Davey
616566c35a Renamed sortGameObjects to sortDropZones and then repurposed the old method for the new render list sorting technique. 2021-01-07 12:32:00 +00:00
Richard Davey
00d8b6a009 Invoke camera.addToRenderList method 2021-01-07 12:31:31 +00:00
Richard Davey
dc925267fc Added the new renderList property and addToRenderList method 2021-01-07 12:31:12 +00:00
Richard Davey
5481a64023 Clear the render list if not destroying the camera 2021-01-07 12:30:46 +00:00
Richard Davey
3db77c7a10 Use Scene Display List if not available 2021-01-07 12:22:09 +00:00
Richard Davey
c6ad8b1306 Better parameter name 2021-01-07 11:03:59 +00:00
Richard Davey
ceac5bdd4a Lint fix. 2021-01-06 11:07:14 +00:00
Richard Davey
22e170e417 Updated documentation. Fix #5488 2021-01-06 11:07:05 +00:00
jdcook
b935c5bf03 added null check for WebAudio pannerNode 2021-01-05 16:37:24 -06:00
Richard Davey
f7a41b7301 Preparing for 3.52 2021-01-05 17:59:00 +00:00
Richard Davey
c124d4c0a6
Merge pull request #5467 from rexrainbow/improve-postfx-pipeline
Remove a type of Post Pipeline instances, not only a single instance
2021-01-04 16:14:48 +00:00
Richard Davey
a19e4770df The Layer Game Object has been given all of the missing properties and methods from Game Object to make the class shapes identical. This includes the properties parentContainer, tabIndex, input and body. You cannot set any of these properties, they are ignored by the Layer itself. It also includes the methods: setInteractive, disableInteractive and removeInteractive. A Layer cannot be enabled for input or have a physics body. Fix #5459 2021-01-04 16:11:33 +00:00
Richard Davey
b71bfcf7ba The error RENDER WARNING: there is no texture bound to the unit ... would be thrown when destroying a Text Game Object, or any Game Object that uses its own custom texture. Destroying such an object will now reset the WebGL Texture cache. Fix #5464 2021-01-04 15:51:14 +00:00
Richard Davey
4fbdbb8a04 The error RENDER WARNING: there is no texture bound to the unit ... would be thrown when trying to restart a Scene. When a Scene is shutdown is will now reset the WebGL Texture cache. Fix #5464 2021-01-04 15:51:02 +00:00
Richard Davey
a765b7edfc WebGLRenderer.isTextureClean is a new boolean property that tracks of all of the multi-textures are in a clean 'default' state, to avoid lots of gl texture binds and activations during a Scene restart or destruction process. 2021-01-04 15:49:39 +00:00
Richard Davey
5457e463b1 Use displayList.getIndex 2021-01-04 12:43:34 +00:00
Richard Davey
2a38e78bb4 Layer.destroy will now call destroy on all of its children as well. Layer.destroy will now emit the DESTROY event at the start of the method. Fix #5466 2021-01-04 11:59:00 +00:00
Richard Davey
cf2c607ac1 Canvas Tilemap Rendering is now working again. Fix #5480 2021-01-04 11:52:35 +00:00
Richard Davey
1b0649ed34 Fixed issue causing Cannot read property 'pipelines' of null to be thrown if using 3.50 with the HEADLESS renderer. Fix #5468 2021-01-04 11:22:00 +00:00
Richard Davey
a3726a9f68
Merge pull request #5472 from cjw6k/master
Check event.type in duplicate event bailout
2020-12-30 14:06:05 +00:00
Richard Davey
e70e3a3a80 Preparing for 3.51 2020-12-29 13:11:03 +00:00
cjw6k
19c2874166
Added prevType to constructor. 2020-12-28 17:37:54 -04:00
cjw6k
8771c81649
Check event.type in duplicate event bailout
Fixes #5471.
2020-12-27 17:24:14 -04:00
Rex
60c42016b6 Remove a type of Post Pipeline instances, not only a single instance 2020-12-25 17:05:50 +08:00
Richard Davey
b3b74a1108 3.50.1 2020-12-21 13:28:38 +00:00
Richard Davey
afda0febcd The new Web Audio Panning feature breaks WebAudio on Safari (OSX and iOS). The stero panner node is now only created if supported. Fix #5460 2020-12-21 13:28:22 +00:00
Richard Davey
ba1570089c Namespace adjustments 2020-12-17 11:40:03 +00:00
Richard Davey
e7aff5d0dc Data type fix 2020-12-16 10:25:27 +00:00
Richard Davey
6912124780 Fixed docs 2020-12-15 16:05:34 +00:00
Richard Davey
7880087fd8 Removing beta status 2020-12-14 14:31:09 +00:00
Richard Davey
3e9350ed05 Added JSDocs 2020-12-14 14:07:57 +00:00
Richard Davey
67b3f812f8 JSDocs 2020-12-14 13:50:50 +00:00
Richard Davey
4fb03907ba Stricter removal 2020-12-14 13:50:44 +00:00
Richard Davey
00ec07d67f JSDoc update 2020-12-14 13:36:51 +00:00
Richard Davey
cbe1a3219a JSDoc improvements 2020-12-14 13:33:42 +00:00
Richard Davey
e08b5386dd Removed follow from render code 2020-12-14 11:51:16 +00:00
Richard Davey
7ff4c5958b Fire particle from follower position. Fix #5437 2020-12-14 11:46:19 +00:00
Richard Davey
675e83e539 Fix inverted RenderTexture snapshot. Fix #5445 2020-12-14 10:52:05 +00:00
Richard Davey
2a49b4aa80 The WebAudioSoundManager will no longer try to unlock itself if the Game hasn't already booted and been added to the DOM. It will now wait for the BOOT event and unlock based on that. Fix #5439 2020-12-14 10:37:00 +00:00
Richard Davey
33253a7469 Fixed version numbers and JSDocs. #5274 2020-12-14 10:11:30 +00:00
Richard Davey
dde5b250e3
Merge pull request #5274 from pi-kei/sound-panning
Add ability to pan sounds
2020-12-14 10:00:33 +00:00
Richard Davey
1d58620e35 Don't render debug if not orthogonal #5447 2020-12-14 09:48:29 +00:00
Richard Davey
f5376b20a4 BitmapText Drop Shadow working. Fix #5446 2020-12-14 09:34:32 +00:00
Richard Davey
5a532da7bf Disable scissor before clearing. 2020-12-14 09:08:28 +00:00
Richard Davey
c83622d349 Always return polygon, even if points <= 2. 2020-12-14 09:03:35 +00:00
Richard Davey
0cd192eec8 Swapped for Color component. Fix #5435 2020-12-11 15:56:21 +00:00
Richard Davey
1a65f50a25 Added new renderDirect hook which RenderTexture can use. Fix #5431 2020-12-11 13:40:53 +00:00
Richard Davey
166c333d13 Should rebind shaders too 2020-12-11 12:41:48 +00:00
Richard Davey
ab1646c2a0 Update BaseCamera.js 2020-12-11 12:41:35 +00:00
Richard Davey
9412a93fdb Remove log 2020-12-11 11:46:28 +00:00
Richard Davey
59e89fa788 All Game Objects will now listen for ADDED_TO_SCENE and REMOVED_FROM_SCENE events and call the handlers. Therefore, removed GO specific implementations. 2020-12-11 11:44:21 +00:00
Richard Davey
519afd031b Fixed Camera Fade Effect check. Fix #5438 2020-12-11 11:29:16 +00:00
Richard Davey
32440cb238 Defaults to renderer aspect ratio to help with issues like #5444 2020-12-11 11:05:47 +00:00
Richard Davey
69f4a6d8fb Added getAspectRatio method 2020-12-11 11:05:20 +00:00
Richard Davey
e4be6dbc90 Fixed JSDocs and removed unused method 2020-12-11 10:33:53 +00:00
Richard Davey
11990bccb4 Added global projection matrix back and removed events 2020-12-11 10:26:15 +00:00
Richard Davey
0d67548343 Compare projection matrix with renderer 2020-12-11 10:24:47 +00:00
Richard Davey
8839007e0f Update the projection matrix on bind 2020-12-11 10:24:27 +00:00
Richard Davey
dbae58368d Removed event as no longer required 2020-12-11 10:24:15 +00:00
Richard Davey
27da1dfa4b Clear just the color buffer 2020-12-11 10:24:05 +00:00
Richard Davey
1857c3f2da Send dimensions and reset scissors 2020-12-10 18:07:41 +00:00
Richard Davey
7acbd816f3 Added new Projection Update event and respond to it 2020-12-10 18:07:25 +00:00
Richard Davey
4f5cedde03 Better method name. Reset once done. 2020-12-10 16:58:34 +00:00
Richard Davey
f1dbea4ead beginCapture can accept dimensions. Reset scissor enables even if same size. Always set drawing height. 2020-12-10 16:55:00 +00:00
Richard Davey
21b968363c Don't resize if already same size. Better binding handling. 2020-12-10 16:53:48 +00:00
Richard Davey
2be3b7aa59 Fixed typos 2020-12-10 16:53:26 +00:00
Richard Davey
73a0c9d2ce Remove unused code 2020-12-09 18:04:53 +00:00
Richard Davey
e03c514b03 Fixed WebGL erase mode 2020-12-09 15:55:11 +00:00
Richard Davey
197aa9df0f Update WebGLRenderer.js 2020-12-09 15:55:02 +00:00
Richard Davey
edbef4a04a Added eraseMode parameter 2020-12-09 15:54:56 +00:00
Richard Davey
16d4d11939 Final fixes to blitFrame 2020-12-09 15:20:09 +00:00
Richard Davey
1cb6d525be New blitFrame working. Now to adjust when src > target height. 2020-12-09 14:08:24 +00:00
Richard Davey
daadb7d5b6 Fixed way in which custom vertices are defined in the config 2020-12-09 12:18:16 +00:00
Richard Davey
827851d02c Update RenderTexture.js 2020-12-08 17:54:37 +00:00
Richard Davey
0c4eec0fd9 Now using new Render Target approach (texture blend still need to be added) 2020-12-08 17:38:42 +00:00
Richard Davey
54e306fe3e Added setProjectionMatrix and all of the new pipeline events 2020-12-08 17:38:19 +00:00
Richard Davey
5f279bf4a4 Added RenderTarget, begingCapture, endCapture, resetScissor and resetViewport 2020-12-08 17:37:59 +00:00
Richard Davey
f93c3ea05f Added Pipeline events 2020-12-08 16:15:46 +00:00
Richard Davey
f18d615b40 Update SpriteWebGLRenderer.js 2020-12-08 16:15:16 +00:00
Richard Davey
c2bce98532 Added copyFrameRect method 2020-12-08 16:15:06 +00:00
Richard Davey
cb71fe35cd Fixed name #5432 2020-12-07 17:10:25 +00:00
Richard Davey
3154bf2e6f Update Container.js 2020-12-07 13:11:49 +00:00
Richard Davey
79d252589f Update Rope.js 2020-12-07 13:09:45 +00:00
Richard Davey
7dba1c4b2f Update BaseCamera.js 2020-12-07 13:09:12 +00:00
Richard Davey
607fb6ff7c Make docs crystal clear 2020-12-07 12:25:57 +00:00
Richard Davey
d6d5c09552 The Shader Game Object now supports being able to use a Render Texture as a sampler2D texture on the shader. Fix #5423 2020-12-07 12:19:42 +00:00
Richard Davey
15a6f50d2c Fixed functions not appearing in the namespace. Fix #5432 2020-12-07 10:11:47 +00:00
Richard Davey
0951a1d2ea Fixed tint property. Fix #5433 2020-12-07 09:42:21 +00:00
Richard Davey
402e6d23b1 Testing making the pipeline responsible for setting the buffer to cut down on potential points of failure 2020-12-04 18:06:16 +00:00